/* ═══════════════════════════════════════════════════════════════
   diaspora.ro — Profil Utilizator v1.0
   Mobile-first + Desktop responsive
   ─────────────────────────────────────────────────────────────── */

/* ── RESET / BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; width: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font, system-ui, sans-serif);
  font-size: var(--fs-md, 15px);
  line-height: var(--lh-normal, 1.5);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── TOPBAR ── */
.pf-topbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.pf-tb-inner {
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px;
  max-width: 900px; margin: 0 auto;
}
.pf-back { flex-shrink: 0; color: var(--brand); }
.pf-tb-name {
  flex: 1;
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.pf-tb-name.visible { opacity: 1; transform: translateY(0); }
.pf-tb-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ── MAIN SCROLL ── */
.pf-scroll {
  overflow-y: auto;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}
/* Desktop max-width */
@media (min-width: 768px) {
  .pf-scroll { max-width: 900px; margin: 0 auto; }
}

/* ── HERO ── */
.pf-hero { position: relative; background: var(--bg); }

/* Cover photo */
.pf-cover {
  position: relative;
  width: 100%;
  height: 220px;
  background: linear-gradient(160deg, var(--bg2) 0%, var(--bg3) 100%);
  overflow: hidden;
}
@media (min-width: 600px) { .pf-cover { height: 312px; } }

.pf-cover-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: opacity 0.3s;
}
.pf-cover-img[src=""] { opacity: 0; }

.pf-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
}

.pf-cover-edit {
  position: absolute; bottom: 12px; right: 12px;
  display: none;
  align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  border-radius: 22px;
  color: #fff;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.pf-cover-edit:hover { background: rgba(0,0,0,0.80); }
.pf-cover-edit:active { transform: scale(0.97); }
body.pf-own .pf-cover-edit { display: flex; }

/* Avatar */
.pf-avatar-wrap {
  position: absolute;
  bottom: -52px; left: 16px;
}
@media (min-width: 600px) { .pf-avatar-wrap { bottom: -64px; left: 24px; } }

.pf-avatar-ring {
  position: relative;
  width: 104px; height: 104px;
  border-radius: 50%;
  padding: 3px;
  background: var(--bg);
}
@media (min-width: 600px) {
  .pf-avatar-ring { width: 128px; height: 128px; }
}

/* Story ring when has story */
.pf-avatar-ring.has-story {
  background: conic-gradient(from 180deg, #f59e0b, #ef4444, #ec4899, #8b5cf6, #3b82f6, #10b981, #f59e0b);
}

.pf-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
  border: 3px solid var(--bg);
}
.pf-avatar-initials {
  font-size: 36px; font-weight: var(--fw-black);
  color: #fff; line-height: 1;
  pointer-events: none; user-select: none;
}
@media (min-width: 600px) { .pf-avatar-initials { font-size: 44px; } }

.pf-avatar-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.pf-avatar-img[src=""] { display: none; }

/* Online dot */
.pf-online-dot {
  position: absolute; bottom: 5px; right: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg);
  display: none;
}
.pf-online-dot.visible { display: block; }

/* Avatar edit button */
.pf-avatar-edit {
  position: absolute; bottom: 4px; right: 4px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink2);
  display: none;
  align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: background 0.15s, transform 0.1s;
}
.pf-avatar-edit:hover { background: var(--ink); }
.pf-avatar-edit:active { transform: scale(0.93); }
body.pf-own .pf-avatar-edit { display: flex; }

/* Hero info */
.pf-hero-info {
  padding: 60px 16px 16px;
}
@media (min-width: 600px) { .pf-hero-info { padding: 72px 24px 20px; } }

.pf-name {
  font-size: var(--fs-2xl); font-weight: var(--fw-black);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--ink);
  margin-bottom: 4px;
}
@media (min-width: 600px) { .pf-name { font-size: var(--fs-3xl); } }

.pf-bio-short {
  font-size: var(--fs-md);
  color: var(--ink2);
  line-height: var(--lh-relaxed);
  margin-bottom: 8px;
}
.pf-bio-short:empty { display: none; }

.pf-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-bottom: 12px;
}
.pf-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--fs-sm); color: var(--ink2);
}

/* Stats */
.pf-stats-row {
  display: flex; gap: 0;
  margin-bottom: 12px;
}
.pf-stat {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 6px 16px 6px 0;
  gap: 1px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.pf-stat:hover { background: var(--card-hover); }
.pf-stat-val {
  font-size: var(--fs-xl); font-weight: var(--fw-black);
  color: var(--ink); line-height: 1;
}
.pf-stat-lbl {
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  color: var(--ink3); text-transform: uppercase; letter-spacing: var(--ls-wide);
}

/* Mutual friends */
.pf-mutual {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.pf-mutual-avatars { display: flex; }
.pf-mutual-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad);
  border: 2px solid var(--bg);
  margin-left: -8px; first-child:margin-left:0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  overflow: hidden;
}
.pf-mutual-av:first-child { margin-left: 0; }
.pf-mutual-text { font-size: var(--fs-sm); color: var(--ink2); }

/* Action buttons */
.pf-actions {
  padding: 0 16px 16px;
  margin-bottom: 2px;
  overflow: visible;
}
@media (min-width: 600px) {
  .pf-actions { padding: 0 24px 20px; }
}
#pf-own-actions, #pf-other-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  width: 100%;
}
#pf-own-actions > *, #pf-other-actions > * {
  flex-shrink: 1;
  min-width: 0;
}
/* Butonul principal ia spatiu disponibil, celelalte raman compacte */
#pf-own-actions .pf-btn-primary,
#pf-other-actions .pf-btn-primary {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 220px;
}
#pf-own-actions .pf-btn-secondary,
#pf-other-actions .pf-btn-secondary {
  flex: 1 1 auto;
  min-width: 100px;
  max-width: 180px;
}
#pf-own-actions .pf-btn-icon,
#pf-other-actions .pf-btn-icon {
  flex: 0 0 auto;
}
/* Pe ecrane mici, butoanele se stivuiesc elegant */
@media (max-width: 380px) {
  #pf-own-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #pf-own-actions .pf-btn-primary,
  #pf-own-actions .pf-btn-secondary {
    max-width: 100%;
    width: 100%;
    justify-content: center;
  }
  #pf-own-actions .pf-btn-icon {
    width: 100%;
    justify-content: center;
    border-radius: 10px;
    padding: 9px;
  }
}
.pf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 16px;
  border-radius: 10px;
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
  transition: all 0.15s; cursor: pointer;
  white-space: nowrap; border: none;
}
.pf-btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 10px rgba(124,58,237,0.35);
}
.pf-btn-primary:hover { background: var(--brand2); box-shadow: 0 4px 16px rgba(124,58,237,0.5); }
.pf-btn-primary:active { transform: scale(0.97); }
.pf-btn-secondary {
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--border);
}
.pf-btn-secondary:hover { background: var(--card-hover); border-color: var(--border-b); }
.pf-btn-secondary:active { transform: scale(0.97); }
.pf-btn-icon {
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--border);
  padding: 9px 11px; border-radius: 10px;
}
.pf-btn-icon:hover { background: var(--card-hover); }
.pf-btn-sm { padding: 6px 14px; font-size: var(--fs-sm); }

/* ── TABS ── */
.pf-tabs {
  display: flex; overflow-x: auto;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  position: sticky; top: 57px; z-index: 150;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab {
  flex: 1; min-width: 80px; padding: 13px 10px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--ink2); white-space: nowrap; text-align: center;
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.pf-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.pf-tab:hover:not(.active) { color: var(--ink); }

/* ── VIEWS ── */
.pf-view { display: none; padding: 12px; }
.pf-view.active { display: block; }
@media (min-width: 600px) { .pf-view { padding: 16px 24px; } }

/* ── CARD ── */
.pf-card {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.pf-card-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.pf-card-hdr h3 {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
}
.pf-section-hdr {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  margin-bottom: 10px;
}
.pf-section-title {
  font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--ink);
}
.pf-link-btn {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--brand); cursor: pointer; padding: 4px 0;
  transition: opacity 0.15s;
}
.pf-link-btn:hover { opacity: 0.75; }

/* ── ABOUT LIST ── */
.pf-about-list { display: flex; flex-direction: column; gap: 4px; }
.pf-about-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 10px;
  transition: background 0.15s;
}
.pf-about-item:hover { background: var(--card-hover); }
.pf-about-content { flex: 1; min-width: 0; }
.pf-about-val {
  display: block;
  font-size: var(--fs-sm); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-about-val.pf-empty { color: var(--ink3); }
.pf-about-priv {
  display: block; font-size: var(--fs-xs); color: var(--ink3);
  margin-top: 1px;
}
.pf-about-edit { display: none; }
body.pf-own .pf-about-edit { display: flex; }

/* ── BIO EXTENDED ── */
.pf-bio-extended {
  font-size: var(--fs-md); color: var(--ink2);
  line-height: var(--lh-relaxed);
  white-space: pre-wrap; word-break: break-word;
}
.pf-muted { color: var(--ink3); }

/* ── FRIENDS GRID ── */
.pf-friends-filter {
  display: flex; gap: 8px; margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.pf-friends-filter::-webkit-scrollbar { display: none; }
.pf-filter-pill {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--ink2); background: var(--card-hover);
  white-space: nowrap; transition: all 0.15s; cursor: pointer;
}
.pf-filter-pill.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}

.pf-friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .pf-friends-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 700px) { .pf-friends-grid { grid-template-columns: repeat(6, 1fr); } }

.pf-friend-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; cursor: pointer; text-align: center;
  padding: 8px; border-radius: 12px;
  transition: background 0.15s, transform 0.1s;
}
.pf-friend-card:hover { background: var(--card-hover); }
.pf-friend-card:active { transform: scale(0.97); }
.pf-friend-av {
  width: 72px; height: 72px; border-radius: 12px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 26px; font-weight: 800; color: #fff;
}
.pf-friend-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-friend-name {
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  color: var(--ink); line-height: 1.3;
  max-width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  width: 100%;
}
.pf-friend-mutual {
  font-size: 10px; color: var(--ink3);
}

/* ── PHOTO GRID ── */
.pf-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.pf-photo-cell {
  aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--bg2); cursor: zoom-in;
  position: relative;
}
.pf-photo-cell img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.2s;
}
.pf-photo-cell:hover img { transform: scale(1.04); }
.pf-photo-more-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-2xl); font-weight: var(--fw-black); color: #fff;
}

/* ── VIDEO GRID ── */
.pf-video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.pf-video-cell {
  border-radius: 12px; overflow: hidden;
  background: var(--bg2); cursor: pointer;
  position: relative;
}
.pf-video-cell img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; display: block;
}
.pf-video-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.pf-video-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
}
.pf-video-dur {
  position: absolute; bottom: 6px; right: 8px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.6); border-radius: 4px;
  padding: 1px 5px;
}
.pf-video-title {
  padding: 8px 10px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── FEATURED STRIP ── */
.pf-featured-strip { margin-bottom: 12px; }
.pf-featured-grid {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pf-featured-grid::-webkit-scrollbar { display: none; }
.pf-feat-cell {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: var(--bg2); cursor: zoom-in;
  position: relative;
}
.pf-feat-cell img { width: 100%; height: 100%; object-fit: cover; }

/* ── LIFE EVENTS ── */
.pf-life-event {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.pf-life-event:last-child { border-bottom: none; }
.pf-le-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brandl));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.pf-le-content { flex: 1; }
.pf-le-title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink); }
.pf-le-date { font-size: var(--fs-xs); color: var(--ink3); margin-top: 2px; }
.pf-le-desc { font-size: var(--fs-sm); color: var(--ink2); margin-top: 4px; }
.pf-le-actions { display: flex; gap: 4px; }

/* ── PINNED POST PREVIEW ── */
.pf-pinned-wrap {
  background: var(--card); border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px; margin-bottom: 12px;
}

/* ── EMPTY STATE ── */
.pf-empty-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px;
  text-align: center;
  color: var(--ink3);
  font-size: var(--fs-sm);
}

/* ── SKELETON LOADING ── */
.pf-post-skeleton, .pf-friends-skeleton {
  display: flex; gap: 12px; padding: 14px;
  background: var(--card); border-radius: 16px;
  border: 1px solid var(--border); margin-bottom: 10px;
}
.pf-friends-skeleton {
  flex-direction: column; align-items: center;
  padding: 10px; gap: 8px;
}
.sk-line {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
.sk-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.sk-friend-av { width: 72px; height: 72px; border-radius: 12px; }
.sk-block { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.sk-w40 { height: 12px; width: 40%; }
.sk-w50 { height: 12px; width: 50%; }
.sk-w60 { height: 11px; width: 60%; }
.sk-w70 { height: 14px; width: 70%; }
.sk-w80 { height: 14px; width: 80%; }
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ── MODAL ── */
.pf-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
}
@media (min-width: 600px) {
  .pf-modal-overlay { align-items: center; }
}
.pf-modal-overlay.open {
  display: flex; opacity: 1;
}
.pf-modal {
  width: 100%; max-width: 600px;
  max-height: 92vh; overflow-y: auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@media (min-width: 600px) {
  .pf-modal {
    border-radius: 20px;
    transform: scale(0.9) translateY(0);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  }
}
.pf-modal-overlay.open .pf-modal {
  transform: translateY(0);
}
@media (min-width: 600px) {
  .pf-modal-overlay.open .pf-modal {
    transform: scale(1) translateY(0);
  }
}
.pf-modal-sm { max-width: 420px; }
.pf-modal-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
}
.pf-modal-hdr h2 {
  flex: 1; font-size: var(--fs-lg); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
}
.pf-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 0; }

/* ── FORM ── */
.pf-form-group {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pf-form-group:last-child { border-bottom: none; }
.pf-label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--ink2);
  display: flex; justify-content: space-between; align-items: center;
}
.pf-char-counter {
  font-size: var(--fs-xs); font-weight: var(--fw-regular);
  color: var(--ink3);
}
.pf-char-counter.warn { color: var(--amber); }
.pf-char-counter.error { color: var(--red); }
.pf-input, .pf-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: var(--fs-md); line-height: var(--lh-normal);
  outline: none; resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pf-input:focus, .pf-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.pf-input::placeholder, .pf-textarea::placeholder { color: var(--ink3); }
.pf-priv-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.pf-select-sm {
  font-size: var(--fs-xs); color: var(--ink2);
  background: transparent; border: none; outline: none;
  cursor: pointer; padding: 2px 4px;
}

/* ── EDIT PREVIEW (cover + avatar in modal) ── */
.pf-edit-preview {
  position: relative;
  margin: -16px -16px 0;
  background: var(--bg2);
}
.pf-edit-cover-preview {
  height: 140px; background: var(--bg3);
  position: relative; overflow: hidden;
}
.pf-edit-cover-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.pf-edit-cover-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
  background: rgba(0,0,0,0.35); color: #fff;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  transition: background 0.15s;
}
.pf-edit-cover-label:hover { background: rgba(0,0,0,0.55); }
.pf-edit-cover-label input { display: none; }
.pf-edit-av-wrap {
  position: absolute; bottom: -36px; left: 16px;
}
.pf-edit-av {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--grad);
  border: 3px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 26px; font-weight: 800; color: #fff;
  position: relative;
}
.pf-edit-av img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.pf-edit-av img[src=""] { display: none; }
.pf-edit-av-label {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45); cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.pf-edit-av-wrap:hover .pf-edit-av-label { opacity: 1; }
.pf-edit-av-label input { display: none; }
.pf-modal-body .pf-form-group:first-child { margin-top: 54px; }

/* ── LIFE EVENT TYPES ── */
.pf-event-types {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pf-event-type {
  padding: 12px 14px; border-radius: 12px;
  background: var(--card); border: 1.5px solid var(--border);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--ink); text-align: left;
  transition: all 0.15s; cursor: pointer;
}
.pf-event-type:hover {
  border-color: var(--brand);
  background: rgba(124,58,237,0.06);
  color: var(--brand);
}
.pf-event-type.selected { border-color: var(--brand); background: rgba(124,58,237,0.12); }
.pf-event-form-back {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  font-size: var(--fs-md); font-weight: var(--fw-semibold);
}

/* ── BOTTOM SHEET (user menu) ── */
.pf-sheet-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.55);
  display: none; align-items: flex-end;
  opacity: 0; transition: opacity 0.25s;
}
.pf-sheet-overlay.open { display: flex; opacity: 1; }
.pf-sheet {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.pf-sheet-overlay.open .pf-sheet { transform: translateY(0); }
.pf-sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border-b); margin: 8px auto 12px;
}
.pf-sheet-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; width: 100%; text-align: left;
  transition: background 0.12s;
}
.pf-sheet-item:hover { background: var(--card-hover); }
.pf-sheet-item > div { display: flex; flex-direction: column; gap: 2px; }
.pf-sheet-item strong { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--ink); }
.pf-sheet-item span { font-size: var(--fs-sm); color: var(--ink3); }
.pf-sheet-divider { height: 8px; background: var(--bg2); margin: 6px 0; }
.pf-sheet-danger strong { color: var(--red) !important; }
.ic-red { color: var(--red); }

/* ── LIGHTBOX ── */
.pf-lightbox {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.96);
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
}
.pf-lightbox.open { display: flex; }
.pf-lb-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.12); border-radius: 50%;
  width: 44px; height: 44px; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.pf-lb-close:hover { background: rgba(255,255,255,0.22); }
.pf-lb-prev, .pf-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12); border-radius: 50%;
  width: 48px; height: 48px; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
  z-index: 1;
}
.pf-lb-prev { left: 12px; }
.pf-lb-next { right: 12px; }
.pf-lb-prev:hover, .pf-lb-next:hover { background: rgba(255,255,255,0.25); }
.pf-lb-inner {
  max-width: 90vw; max-height: 85vh;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center;
}
.pf-lb-img {
  max-width: 100%; max-height: 80vh;
  object-fit: contain; border-radius: 4px;
}
.pf-lb-caption {
  font-size: var(--fs-sm); color: rgba(255,255,255,0.7);
  text-align: center; max-width: 500px;
}

/* ── TOAST ── */
.pf-toast-stack {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.pf-toast {
  padding: 11px 20px;
  background: var(--ink); color: var(--bg);
  border-radius: 24px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toast-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.pf-toast.error { background: var(--red); color: #fff; }
.pf-toast.success { background: var(--green); color: #fff; }
.pf-toast.out { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in  { from { opacity:0; transform:translateY(12px) scale(0.9); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toast-out { to   { opacity:0; transform:translateY(6px) scale(0.95); } }

/* ── DESKTOP LAYOUT OVERRIDE ── */
@media (min-width: 768px) {
  .pf-scroll { padding: 0 0 40px; }
  .pf-cover { height: 312px; }
  .pf-avatar-wrap { left: 24px; bottom: -68px; }
  .pf-avatar-ring { width: 148px; height: 148px; }
  .pf-avatar-initials { font-size: 52px; }
  .pf-hero-info { padding: 80px 24px 20px; }
  .pf-name { font-size: var(--fs-3xl); }
  #pf-own-actions, #pf-other-actions { flex-wrap: wrap; gap: 8px; }
  .pf-view { max-width: 680px; margin: 0 auto; padding: 20px 0; }
  .pf-modal-overlay { padding: 20px; }
}

/* Previne overlap butoane la orice latime de ecran */
.pf-actions {
  overflow: visible;
}
#pf-own-actions > .pf-btn,
#pf-other-actions > .pf-btn,
#pf-own-actions > .pf-btn-icon,
#pf-other-actions > .pf-btn-icon {
  flex-shrink: 0;
  max-width: 100%;
}

/* ── ACCESSIBILITY ── */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
