/* =========================================================================
 * Hồ sơ (#/profile, #/u/…): băng avatar, số liệu, bạn bè, tạo avatar, bộ đồ, huy hiệu tháng, thành tích.
 * Màu lấy từ biến của bảng màu (tokens.css / themes.css) nên tự đổi theo 8 bảng màu và ngày / đêm.
 * Các màu cố định duy nhất: nền pastel của avatar (người học tự chọn) và màu riêng từng huy hiệu.
 * ========================================================================= */
.pf-page {
  --pf-act: var(--l-blue);
  --pf-hero-empty: color-mix(in srgb, var(--l-sky) 22%, var(--surface));
  --pf-me: var(--l-blue);
  --pf-them: var(--l-blue);
  --pf-me2: color-mix(in srgb, var(--muted) 70%, transparent);
  max-width: 760px; margin: 0 auto;
}
.pf-page h1, .pf-page h2, .pf-page h3 { margin: 0; }

/* ---------- băng avatar ---------- */
.pf-hero {
  position: relative; height: 232px; border-radius: 22px; overflow: hidden; display: flex; justify-content: center; align-items: flex-end;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .35) 0 2px, transparent 3px) 0 0 / 26px 26px,
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(0, 0, 0, .04)),
    var(--pf-bg);
  border: 2px solid var(--ink-line, var(--border));
  box-shadow: var(--shadow);
}
.pf-hero-av { display: block; line-height: 0; transition: transform .2s; }
.pf-hero-av:hover { transform: translateY(-3px); }
.pf-hero-av.empty { margin-bottom: 12px; }
.pf-hero-av svg { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .12)); }
.pf-hero-act { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 1; }
.pf-ic {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, .88); color: #26262c; border: 1.5px solid rgba(0, 0, 0, .08); box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  text-decoration: none !important;
}
.pf-ic:hover { background: #fff; }
.pf-ic .ic { width: 22px; height: 22px; }
.pf-ic.sm { width: 36px; height: 36px; background: var(--surface-2); color: var(--text); border-color: var(--border); }
.pf-hero-top { position: absolute; inset: 12px 12px auto 12px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; z-index: 1; }
.pf-hero-top h1 { justify-self: center; font-size: 1rem; background: rgba(255, 255, 255, .88); color: #222; padding: 5px 14px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pf-id { padding: 16px 4px 4px; }
.pf-name { font-size: 1.65rem; font-weight: 800; line-height: 1.2; }
.pf-zhname { display: inline-block; margin-top: 4px; font-family: var(--font-zh-serif); font-size: 1.2rem; color: var(--text); text-decoration: none !important; }
.pf-zhname.add { font-family: var(--font); font-size: .9rem; color: var(--pf-act); font-weight: 700; }
.pf-meta { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.pf-meta b { color: var(--text); font-weight: 700; }
.pf-meta.caps { text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; font-weight: 700; }
.pf-counts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0; }
.pf-counts > * { display: flex; flex-direction: column; gap: 2px; padding: 2px 12px; color: inherit; text-decoration: none !important; border-left: 1.5px solid var(--border); min-width: 0; }
.pf-counts > *:first-child { border-left: 0; padding-left: 0; }
.pf-counts b { font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; gap: 3px; min-height: 30px; }
.pf-counts small { color: var(--muted); font-size: .82rem; }
.pf-counts a:hover small { color: var(--pf-act); }
.pf-cdot { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: #fff; }
.pf-cdot .ic { width: 17px; height: 17px; }
.pf-more { font-size: .72rem !important; border: 1.5px solid var(--border); border-radius: 6px; padding: 1px 4px; margin-left: 2px; }
.pf-actions { display: flex; gap: 10px; align-items: stretch; }
.pf-actions .btn.wide { flex: 1; }
.pf-add { color: var(--pf-act); font-weight: 800; letter-spacing: .02em; border: 2px solid var(--border); }
.pf-sharebtn, .pf-actions .btn.icon { width: 52px; border: 2px solid var(--border); color: var(--pf-act); }
.pf-follow { font-weight: 800; letter-spacing: .02em; }
.pf-follow.primary { background: var(--pf-act); }
.pf-follow.on { color: var(--ok); border: 2px solid var(--border); }
.pf-follow.blocked { background: var(--surface-3); color: var(--muted); }
.pf-fyou { margin: 10px 0 0; color: var(--ok); font-size: .88rem; font-weight: 600; }

/* ---------- thẻ sự kiện bộ đồ, hoàn thiện hồ sơ ---------- */
.pf-event {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 16px; padding: 16px 16px 0;
  border-radius: 18px; color: #fff; text-decoration: none !important; overflow: hidden;
  background: linear-gradient(135deg, #4a2f8a, #6d3c91 55%, #b83c8b);
  border: 2px solid var(--ink-line, transparent); box-shadow: var(--print-shadow, var(--shadow));
}
.pf-event-t { display: flex; flex-direction: column; gap: 4px; padding-bottom: 16px; }
.pf-event-t b { font-size: 1.12rem; line-height: 1.3; }
.pf-event-t span { font-size: .86rem; opacity: .92; }
.pf-event-left { display: inline-flex; align-items: center; gap: 4px; color: #ffd6f0; font-weight: 700; }
.pf-event-go { align-self: flex-start; margin-top: 6px; background: #fff !important; color: #4a2f8a !important; font-weight: 800; border: 0; }
.pf-event-av { display: flex; align-items: flex-end; margin-right: -6px; }
.pf-event-av svg { margin-left: -22px; }
.pf-complete {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 16px; padding: 18px;
  border-radius: 18px; background: color-mix(in srgb, var(--l-sky) 14%, var(--surface)); border: 2px solid color-mix(in srgb, var(--l-sky) 40%, var(--border));
}
.pf-complete h3 { font-size: 1.15rem; }
.pf-complete p { margin: 2px 0 12px; color: var(--muted); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.pf-complete .btn.primary { background: var(--pf-act); }
.pf-complete-fig { width: 104px; }
.pf-complete-fig .tc, .pf-complete-fig img { max-width: 100%; }

/* ---------- tiêu đề mục, ô tổng quan, biểu đồ ---------- */
.pf-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-size: 1.15rem; }
.pf-h h2, h2.pf-h { font-size: 1.15rem; font-weight: 800; }
.pf-h a { font-size: .85rem; font-weight: 800; color: var(--pf-act); text-transform: uppercase; letter-spacing: .03em; display: inline-flex; align-items: center; gap: 2px; text-decoration: none !important; }
.pf-h a .ic { width: 16px; height: 16px; }
.pf-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; }
.pf-tile-ic { font-size: 1.5rem; line-height: 1; }
.pf-tile.cold .pf-tile-ic { filter: grayscale(1); opacity: .6; }
.pf-tile-t { display: flex; flex-direction: column; min-width: 0; }
.pf-tile-t b { font-size: 1.12rem; font-weight: 800; }
.pf-tile-t small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-week { padding: 14px; }
.pf-chart { width: 100%; height: auto; display: block; }
.pf-grid { stroke: var(--border); stroke-width: 1; }
.pf-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.pf-legend { display: grid; gap: 6px; margin-top: 8px; }
.pf-leg { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: .92rem; }
.pf-leg i { width: 12px; height: 12px; border-radius: 50%; }
.pf-leg span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- hàng huy hiệu tháng / thành tích ---------- */
.pf-mrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 10px; }
.pf-mb, .pf-aw { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 12px; font: inherit; }
.pf-mb:hover, .pf-aw:hover { background: var(--surface-2); }
.pf-mb small, .pf-aw small { font-size: .8rem; font-weight: 700; text-align: center; }
.pf-mb:not(.got) small { color: var(--muted); }
.pf-mb.future { opacity: .55; }
.pf-mb svg, .pf-aw svg { max-width: 100%; height: auto; }
.pf-arow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px 10px; }
.pf-new { position: absolute; top: 0; right: 8%; z-index: 1; background: var(--minibus-red, #d6141c); color: #fff; font-size: .66rem; font-weight: 900; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; border: 1.5px solid #fff; }

/* ---------- gợi ý kết bạn ---------- */
.pf-sugg { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.pf-scard { position: relative; flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 12px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.pf-scard a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: inherit; text-decoration: none !important; min-width: 0; width: 100%; }
.pf-scard b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-scard small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.pf-scard .btn { width: 100%; background: var(--pf-act); }
.pf-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.pf-x:hover { background: var(--surface-2); }

/* ---------- thanh trang con, danh sách người ---------- */
.pf-bar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; margin: 0 0 14px; }
.pf-bar h1 { text-align: center; font-size: 1.12rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-bar-r { justify-self: end; }
.pf-back { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); text-decoration: none !important; }
.pf-back:hover { background: var(--surface-2); }
.pf-list { padding: 0; overflow: hidden; }
.pf-list > p { padding: 16px; margin: 0; }
.pf-urow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1.5px solid var(--border); }
.pf-urow:first-child { border-top: 0; }
.pf-urow-main { flex: 1; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; min-width: 0; }
.pf-urow-main > svg, .pf-urow-main > .pf-mono { flex: 0 0 auto; }
.pf-urow-t { display: flex; flex-direction: column; min-width: 0; }
.pf-urow-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-urow-t small { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { color: var(--muted); }
.pf-fbtn { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 36px; border-radius: 10px; border: 0; cursor: pointer; background: var(--pf-act); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--pf-act) 60%, #000); }
.pf-fbtn:active { transform: translateY(2px); box-shadow: none; }
.pf-fbtn.on { background: var(--surface); color: var(--ok); border: 2px solid var(--border); box-shadow: 0 3px 0 var(--border); }
.pf-fbtn:disabled { opacity: .5; }
.pf-mono { display: inline-grid; place-items: center; border-radius: 50%; background: var(--mono); color: #fff; font-weight: 800; }
.pf-noface { display: grid; place-items: center; width: 90px; height: 90px; margin: 0 auto; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.pf-noface .ic { width: 42px; height: 42px; }
.pf-empty { text-align: center; padding: 26px 18px; }
.pf-empty .tc { margin: 0 auto 6px; }
.pf-empty h3 { font-size: 1.12rem; margin-top: 6px; }
.pf-empty p { max-width: 380px; margin: 6px auto 14px; }
.pf-empty-act { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pf-ftabs { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0; overflow: hidden; background: var(--surface); }
.pf-ftabs a { text-align: center; padding: 12px 6px; font-weight: 800; font-size: .82rem; letter-spacing: .03em; color: var(--muted); text-decoration: none !important; border-bottom: 3px solid var(--border); }
.pf-ftabs a.on { color: var(--pf-act); border-bottom-color: var(--pf-act); }
.pf-ftabs + .pf-list { border-top-left-radius: 0; border-top-right-radius: 0; border: 2px solid var(--border); border-top: 0; }

/* ---------- tìm bạn ---------- */
.pf-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.pf-search:focus-within { border-color: var(--pf-act); }
.pf-search > span { color: var(--muted); display: grid; }
.pf-search input { flex: 1; border: 0 !important; background: transparent !important; padding: 12px 0; font-size: 1rem; outline: none; box-shadow: none !important; min-width: 0; color: var(--text); }
.pf-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.pf-clear { border: 0; background: var(--muted); color: var(--surface); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.pf-clear .ic { width: 14px; height: 14px; }
.pf-detective { text-align: center; padding: 34px 16px 18px; }
.pf-detective p { max-width: 340px; margin: 10px auto 0; }
.pf-invite { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 14px; border: 2px solid color-mix(in srgb, var(--pf-act) 30%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--pf-act) 7%, var(--surface)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pf-invite > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.pf-invite small { color: var(--muted); }
.pf-invite-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--pf-act) 16%, transparent); color: var(--pf-act); }

/* ---------- hồ sơ người khác: báo cáo / chặn ---------- */
.pf-mod { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 26px 0 8px; }
.pf-modb { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 800; font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; border-radius: 10px; }
.pf-modb:hover { background: var(--surface-2); color: var(--text); }
.pf-notice { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--text); border: 1.5px solid color-mix(in srgb, var(--ok) 45%, transparent); font-weight: 600; }
.pf-notice .ic { color: var(--ok); }
.pf-report h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-right: 40px; }
.pf-reasons { display: grid; gap: 8px; margin: 12px 0; }
.pf-reason { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; }
.pf-reason:has(input:checked) { border-color: var(--pf-act, var(--l-blue)); background: color-mix(in srgb, var(--l-blue) 8%, transparent); }
.pf-report textarea { width: 100%; }
.pf-err { color: var(--bad); font-weight: 600; margin: 8px 0 0; }

/* ---------- hộp chia sẻ (mã QR) ---------- */
.pf-share { text-align: center; padding-top: 6px; }
.pf-share h2 { font-size: 1.2rem; margin: 0 36px; }
.pf-share > .muted { margin: 2px 0 12px; }
.pf-qr { position: relative; display: inline-block; padding: 10px; background: #fff; border-radius: 18px; border: 2px solid var(--border); line-height: 0; }
.pf-qr .qr { width: min(240px, 64vw); height: auto; }
.pf-qr-av { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 4px; background: #fff; border-radius: 50%; line-height: 0; }
.pf-qr-brand { margin: 8px 0 14px; font-weight: 800; color: var(--tram-green); font-size: 1.05rem; }
.pf-share-acts { display: flex; gap: 26px; justify-content: center; }
.pf-share-b { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .84rem; cursor: pointer; }
.pf-share-b .ic { width: 56px; height: 56px; padding: 15px; border: 2px solid var(--border); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: 0 3px 0 var(--border); }
.pf-share-b:active .ic { transform: translateY(2px); box-shadow: none; }
.pf-share-hint { font-size: .82rem; margin: 14px 0 0; }

/* ---------- chi tiết thành tích / huy hiệu ---------- */
.pf-award { text-align: center; padding: 8px 4px 4px; }
.pf-award-em { display: flex; justify-content: center; margin: 4px 0 8px; }
.pf-award-em svg { animation: pf-pop .45s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes pf-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pf-date { display: inline-block; padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--gold) 20%, var(--surface)); color: color-mix(in srgb, var(--gold) 70%, var(--text)); font-weight: 800; font-size: .82rem; letter-spacing: .04em; }
.pf-award h2 { font-size: 1.2rem; margin: 10px 0 4px; }
.pf-award-say { font-size: 1.05rem; font-weight: 600; margin: 8px 0; }
.pf-award-prog { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 12px 0 4px; }
.pf-award-prog .progress { height: 14px; }
.pf-award-max { font-weight: 800; color: var(--ok); }
.pf-tiers { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.pf-tier { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; border: 1.5px solid var(--border); font-size: .8rem; color: var(--muted); }
.pf-tier small { font-weight: 800; }
.pf-tier.got { color: var(--text); border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.pf-award-prize { font-size: .82rem; }

/* ---------- huy hiệu tháng, thành tích (trang riêng) ---------- */
.pf-mnow { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pf-mnow > span { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pf-mnow small { color: var(--muted); }
.pf-mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 4px; padding: 16px 8px; }
.pf-asum { display: flex; align-items: center; gap: 18px; }
.pf-asum > div:first-child { display: flex; flex-direction: column; }
.pf-asum-n { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.pf-asum-n small { font-size: 1.1rem; color: var(--muted); font-weight: 700; }
.pf-asum-r { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.pf-records { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.pf-rec { flex: 0 0 140px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.pf-rec b { font-size: 1.4rem; font-weight: 900; }
.pf-rec span { font-size: .84rem; font-weight: 700; line-height: 1.3; }
.pf-rec small { color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .03em; }
.pf-rec.none { opacity: .55; }
.pf-rec.none svg { filter: grayscale(1); }
.pf-awards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pf-award-c { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; text-align: center; }
.pf-award-c:hover { border-color: color-mix(in srgb, var(--gold) 60%, var(--border)); }
.pf-award-c b { font-size: .88rem; line-height: 1.25; }
.pf-award-c small { color: var(--muted); font-size: .76rem; font-weight: 700; }
.pf-award-c:not(.got) b { color: var(--muted); }
.pf-award-c .progress { width: 80%; height: 6px; margin-top: 2px; }
.pf-note { font-size: .84rem; margin: 14px 2px; }

/* ---------- khoá học ---------- */
.pf-course { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1.5px solid var(--border); color: inherit; text-decoration: none !important; }
.pf-course:first-child { border-top: 0; }
.pf-course:hover { background: var(--surface-2); }
.pf-course-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--c); color: #fff; }
.pf-course-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-course-t small { color: var(--muted); }
.pf-course-t .progress { height: 7px; margin-top: 4px; }
.pf-course-n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.pf-course-n small { color: var(--muted); font-weight: 600; font-size: .76rem; }

/* ---------- tạo avatar, chọn diện mạo ---------- */
.pf-editor { display: flex; flex-direction: column; gap: 0; }
.pf-ed-top { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; margin-bottom: 10px; }
.pf-ed-top h1 { text-align: center; font-size: 1.12rem; font-weight: 800; }
.pf-ed-top .pf-x { position: static; width: 40px; height: 40px; color: var(--text); text-decoration: none !important; }
.pf-ed-top .pf-x .ic { width: 24px; height: 24px; }
.pf-done { justify-self: end; border: 0; background: none; color: var(--pf-act); font: inherit; font-weight: 900; letter-spacing: .05em; padding: 8px 6px; cursor: pointer; }
.pf-done:disabled { color: var(--muted); opacity: .6; cursor: default; }
.pf-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 270px; border-radius: 22px; background: var(--pf-bg); border: 2px solid var(--ink-line, var(--border)); overflow: hidden; transition: background .25s; }
.pf-stage-av { line-height: 0; }
.pf-stage-av svg { animation: pf-pop .3s ease both; }
.pf-stage-tools { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pf-tool { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .1); background: rgba(255, 255, 255, .9); color: #26262c; display: grid; place-items: center; cursor: pointer; }
.pf-tool:disabled { opacity: .4; cursor: default; }
.pf-money { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .92) !important; color: #8a6400 !important; font-weight: 800; }
.pf-buy { display: flex; align-self: center; justify-content: center; min-width: 220px; margin-top: 12px; white-space: nowrap; }
.pf-buy.lock { align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--muted); font-weight: 700; font-size: .9rem; }
.pf-ed-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 10px; background: var(--bg); border-bottom: 2px solid var(--border); }
.pf-ed-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.pf-ed-tab .ic { width: 26px; height: 26px; }
.pf-ed-tab small { font-size: .68rem; font-weight: 700; white-space: nowrap; }
.pf-ed-tab.on { color: var(--pf-act); border-bottom-color: var(--pf-act); }
.pf-ed-body { padding: 4px 2px 20px; }
.pf-ed-body h3 { font-size: 1rem; font-weight: 800; margin: 16px 0 10px; }
.pf-swatches { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.pf-sw { flex: 0 0 48px; height: 48px; border-radius: 12px; background: var(--sw); border: 2px solid var(--border); cursor: pointer; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.pf-sw.on { outline: 3px solid var(--pf-act); outline-offset: 2px; border-color: #fff; }
.pf-sw.rwb { background: repeating-linear-gradient(90deg, #d6141c 0 7px, #f2efe8 7px 12px, #0067b1 12px 19px, #f2efe8 19px 24px); }
.pf-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pf-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; color: inherit; font: inherit; box-shadow: 0 3px 0 var(--border); }
.pf-opt.on { border-color: var(--pf-act); background: color-mix(in srgb, var(--pf-act) 10%, var(--surface)); box-shadow: 0 3px 0 color-mix(in srgb, var(--pf-act) 50%, transparent); }
.pf-opt small { font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.2; }
.pf-opt-av { width: 84px; height: 84px; overflow: hidden; border-radius: 10px; line-height: 0; display: grid; place-items: center; background: var(--pf-bg, var(--surface-2)); }
.pf-opt-av svg { width: 84px; height: 84px; }
.pf-opt-av.zoom svg { transform: scale(1.75) translateY(8%); }
.pf-look-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 12px; border-bottom: 2px solid var(--border); }
.pf-look-tabs button { padding: 12px; border: 0; background: none; font: inherit; font-weight: 800; letter-spacing: .05em; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.pf-look-tabs button.on { color: var(--pf-act); border-bottom-color: var(--pf-act); }
.pf-ev-strip { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--l-purple) 12%, var(--surface)); color: var(--text); font-size: .86rem; }
.pf-ev-strip .ic { color: var(--l-purple); flex: 0 0 auto; }
.pf-suits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.pf-suit { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 10px; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: 0 3px 0 var(--border); }
.pf-suit-av { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--pf-bg, var(--surface-2)); display: grid; place-items: end center; overflow: hidden; line-height: 0; }
.pf-suit-av svg { width: 100%; height: auto; }
.pf-suit b { font-size: .92rem; }
.pf-suit small { font-size: .76rem; color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; text-align: center; }
.pf-suit.own small { color: var(--ok); }
.pf-suit.locked .pf-suit-av { filter: grayscale(.85); opacity: .7; }
.pf-suit.sel { border-color: var(--pf-act); background: color-mix(in srgb, var(--pf-act) 9%, var(--surface)); box-shadow: 0 3px 0 color-mix(in srgb, var(--pf-act) 50%, transparent); }
.pf-epic { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 1; background: var(--l-purple); color: #fff; font-size: .66rem; font-weight: 900; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; }
.pf-look-av { text-align: center; padding: 20px 8px; }
.pf-look-av p { max-width: 420px; margin: 0 auto 14px; color: var(--muted); }

/* ---------- hoàn thiện hồ sơ ---------- */
.pf-step-top { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; margin-bottom: 18px; }
.pf-step-bar { height: 16px; }
.pf-step-bar i { background: var(--ok) !important; }
.pf-step { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.pf-step h1 { font-size: 1.45rem; font-weight: 800; }
.pf-step > p { margin: 0; }
.pf-step-fig { display: flex; justify-content: center; margin: 12px 0; }
.pf-step .btn.primary { background: var(--pf-act); }
.pf-skip { color: var(--muted); font-weight: 800; letter-spacing: .05em; }
.pf-input { width: 100%; font-size: 1.05rem; padding: 12px 14px; border-radius: 12px; }
.pf-handle { position: relative; display: flex; align-items: center; }
.pf-handle > span { position: absolute; left: 14px; font-weight: 800; color: var(--muted); }
.pf-handle .pf-input { padding-left: 32px; padding-right: 40px; }
.pf-handle-st { position: absolute; right: 12px; display: grid; }
.pf-handle-st.ok { color: var(--ok); }
.pf-handle-st.bad { color: var(--bad); }
.pf-bubble { margin: 0; align-self: flex-end; background: var(--bad); color: #fff; font-weight: 700; font-size: .86rem; padding: 7px 12px; border-radius: 10px; position: relative; }
.pf-bubble::before { content: ''; position: absolute; right: 22px; top: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--bad); }
.pf-sugglist { border: 2px solid var(--border); border-radius: 12px; overflow: hidden; }
.pf-sugglist small { display: block; padding: 8px 14px; color: var(--muted); font-weight: 800; letter-spacing: .05em; font-size: .72rem; }
.pf-sugglist button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-top: 1.5px solid var(--border); background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.pf-sugglist button:hover { background: var(--surface-2); }
.pf-name-out { min-height: 10px; }
.pf-name-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 2px dashed var(--border); }
.pf-name-zh { font-family: var(--font-zh-serif); font-size: 1.9rem; }
.pf-finish { text-align: center; align-items: center; }

@media (max-width: 560px) {
  .pf-hero { height: 210px; border-radius: 18px; }
  .pf-hero-av svg { width: 180px; height: 180px; }
  .pf-name { font-size: 1.4rem; }
  .pf-counts > * { padding: 2px 8px; }
  .pf-event-av svg { width: 58px; height: 58px; margin-left: -18px; }
  .pf-stage { height: 230px; }
  .pf-stage-av svg { width: 220px; height: 220px; }
  .pf-ed-tab small { display: none; }
  .pf-suits, .pf-awards { gap: 8px; }
  .pf-mrow .pf-mb svg { width: 62px; height: 62px; }
}
.pf-hero-top .pf-back { color: #26262c; width: 42px; height: 42px; }
