/* The profile card: a fixed-height sheet with a sticky header and a sticky tab menu; only the open
   pane scrolls (js/profileUi.js). Loaded after royal.css/families.css so it wins on equal weight. */
.profile-card-wrap { padding: 12px; }
.profile-card {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left;
  width: min(520px, 100%); height: min(86dvh, 680px); max-height: none;
}
.pf-top { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 14px 8px 16px; position: relative; z-index: 1; }
.profile-card .pf-avatar { width: 52px; height: 52px; flex: none; font-size: 24px; }
.pf-who { flex: 1 1 auto; min-width: 0; }
.overlay .profile-card .pf-who h2 { margin: 0; text-align: left; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.overlay .profile-card .pf-who h2::after { display: none; }
.pf-who .hint { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.profile-card #pf-close {
  flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: -4px -4px 0 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; line-height: 1; cursor: pointer;
  background: transparent; border: 1px solid var(--hair-soft); color: var(--ink-2);
}
.profile-card #pf-close:active { background: rgba(255, 200, 110, .08); }

.pf-tabs {
  flex: none; position: relative; display: flex; margin: 0 12px 8px; padding: 3px; border-radius: 14px;
  background: var(--well); border: 1px solid var(--edge-soft); z-index: 1;
}
.pf-ind {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--pf-n, 3)); border-radius: 11px;
  background: linear-gradient(180deg, #f6d98a, #d4a037); transition: transform .18s cubic-bezier(.2, .8, .2, 1); will-change: transform; pointer-events: none;
}
.pf-tab {
  position: relative; flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 2px; border: 0; border-radius: 11px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 700; line-height: 1.4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pf-tab i { font-style: normal; font-size: 13px; line-height: 1.1; }
.pf-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tab.is-on { color: #3a1d00; }
.pf-tab:focus-visible, .profile-card #pf-close:focus-visible { outline: 2px solid #f6d98a; outline-offset: 1px; }

.pf-panes { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
.pf-pane {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(14px + var(--sab, env(safe-area-inset-bottom, 0px))); scrollbar-width: thin; scrollbar-color: rgba(230, 185, 79, .5) transparent;
}
.pf-pane[hidden] { display: none; }
.pf-pane::-webkit-scrollbar { width: 4px; }
.pf-pane::-webkit-scrollbar-thumb { background: rgba(230, 185, 79, .5); border-radius: 4px; }
.pf-pane:focus-visible { outline: 2px solid rgba(246, 217, 138, .6); outline-offset: -2px; }
.pf-pane .hint { font-size: 13px; line-height: 1.45; }
.pf-pane .btn-block { margin-top: 8px; }
.pf-pane .pf-gifts, .pf-pane .pf-log { max-height: none; overflow: visible; }
.pf-pane .pf-look { margin: 0; }
.pf-me { margin-top: 12px; }
.pf-me .pf-rename { min-height: 44px; }
.pf-pane .pf-ti { min-height: 44px; font-size: 13px; line-height: 1.4; display: inline-flex; align-items: center; gap: 4px; }
.pf-pane .pf-av { min-height: 44px; }
.pf-pane .pf-h { line-height: 1.4; }

@media (max-height: 600px) {
  .profile-card-wrap { padding: 6px; }
  .profile-card { height: calc(100dvh - 12px); }
  .pf-top { padding-top: 8px; padding-bottom: 4px; }
  .profile-card .pf-avatar { width: 44px; height: 44px; }
  .pf-tab i { display: none; }
}
@media (max-width: 340px) { .pf-tab { font-size: 11px; } .pf-pane { padding-left: 12px; padding-right: 12px; } }
@media (prefers-reduced-motion: reduce) { .pf-ind { transition: none; } }
