html,body{overflow:auto;height:auto !important;}

.bottom-bar{display:none;}

.profile-main{
  max-width:935px;margin:70px auto 0;padding:0 20px 40px;
}

/* ---- Header section ---- */
.pp-header-section{border-bottom:1px solid var(--border);padding-bottom:20px;margin-bottom:0;}
.pp-header-inner{display:flex;align-items:flex-start;gap:30px;padding:20px 0;}
.pp-avatar{width:80px;height:80px;border-radius:50%;flex-shrink:0;background:var(--surface-2);object-fit:cover;}
.pp-header-right{flex:1;min-width:0;}
.pp-header-top{display:flex;align-items:center;gap:16px;margin-bottom:6px;flex-wrap:wrap;}
.pp-header-top h2{font-family:var(--font-display);font-weight:400;font-size:20px;margin:0;}
.pp-muted{font-size:13px;color:var(--text-muted);margin:2px 0 0;}
.pp-username{font-weight:500;color:var(--text);margin-bottom:8px !important;}
.pp-stats{display:flex;gap:20px;margin-top:10px;font-size:14px;}
.pp-stats strong{font-weight:600;color:var(--text);}
.pp-stats span{color:var(--text-muted);}
.pp-bio-section{padding-top:16px;}
.pp-bio{
  font-size:14px;line-height:1.5;margin:0 0 8px;
  word-wrap:break-word;overflow-wrap:break-word;white-space:normal;
}
.pp-location{display:flex;align-items:center;gap:4px;font-size:13px;margin:0 0 6px;}
.pp-links{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px;}
.pp-links a{
  display:inline-flex;align-items:center;gap:5px;
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:999px;padding:5px 12px;
  font-size:12px;color:var(--text-muted);text-decoration:none;
  font-family:var(--font-display);transition:background .15s,color .15s;
}
.pp-links a:hover{background:var(--surface);color:var(--text);}
.pp-joined{display:flex;align-items:center;gap:4px;font-size:13px;margin:0;}

/* ---- Tabs ---- */
.pp-tabs-divider{
  display:flex;border-bottom:1px solid var(--border);
}
.pp-tab{
  flex:1;background:none;border:none;border-bottom:1px solid transparent;
  padding:14px 0;font-size:13px;font-weight:500;color:var(--text-muted);
  cursor:pointer;font-family:var(--font-display);
  transition:color .15s,border-color .15s;
}
.pp-tab:hover{color:var(--text);}
.pp-tab.active{color:var(--text);border-bottom-color:var(--text);}

/* ---- Posts ---- */
.pp-posts{display:flex;flex-direction:column;gap:1px;padding-top:1px;}
.pp-post-card{
  background:var(--surface);border-bottom:1px solid var(--border);
  padding:16px;
}
.pp-post-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;}
.pp-post-text{
  font-size:14px;line-height:1.5;flex:1;min-width:0;
  word-wrap:break-word;overflow-wrap:break-word;white-space:normal;
}
.pp-post-date{font-size:12px;color:var(--text-muted);margin-top:6px;}
.pp-trash-btn{
  background:none;border:none;color:var(--text-muted);
  padding:4px;border-radius:var(--radius-sm);cursor:pointer;
  flex-shrink:0;transition:color .15s;
}
.pp-trash-btn:hover{color:var(--danger);}
.pp-post-actions{display:flex;gap:2px;flex-shrink:0;align-items:center;}
.pp-bookmark-btn{
  background:none;border:none;color:var(--text-muted);
  padding:4px;border-radius:var(--radius-sm);cursor:pointer;
  flex-shrink:0;transition:color .15s;
}
.pp-bookmark-btn:hover{color:var(--blue);}
.pp-bookmark-btn.bookmarked{color:var(--blue);}
.pp-bookmark-btn.bookmarked svg{fill:var(--blue);}
.pp-post-author{display:flex;align-items:center;gap:10px;margin-bottom:10px;}
.pp-post-author-avatar{width:28px;height:28px;border-radius:50%;flex-shrink:0;background:var(--surface-2);object-fit:cover;}
.pp-post-author-name{font-family:var(--font-display);font-weight:500;font-size:13px;line-height:1.2;}
.pp-post-author-username{font-size:11px;color:var(--text-muted);}
.pp-empty{text-align:center;color:var(--text-muted);padding:60px 0;font-size:14px;}

/* ---- Edit form ---- */
.pp-edit-section{
  max-width:480px;margin:0 auto;padding:24px 0;
}
.pp-edit-section .field-label{font-size:12px;color:var(--text-muted);margin-bottom:4px;margin-top:14px;}
.pp-edit-section .field-label:first-child{margin-top:0;}
.pp-edit-section input,.pp-edit-section select{
  width:100%;background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:10px 14px;
  font-size:14px;color:var(--text);font-family:var(--font-body);
  outline:none;transition:border-color .2s;box-sizing:border-box;
}
.pp-edit-section input:focus,.pp-edit-section select:focus{border-color:var(--blue-600);}
.pp-edit-section input::placeholder{color:var(--text-muted);}
.pp-edit-section .optional{color:var(--text-muted);font-weight:400;}

.edit-actions{display:flex;gap:8px;margin-top:20px;justify-content:flex-end;}
.btn-text{
  background:none;border:none;color:var(--text-muted);
  padding:8px 16px;border-radius:999px;font-size:13px;cursor:pointer;
  font-family:var(--font-display);
}
.btn-text:hover{color:var(--text);}
.btn-primary{
  background:var(--blue-600);border:none;color:#fff;
  padding:8px 20px;border-radius:999px;font-size:13px;font-weight:500;cursor:pointer;
  font-family:var(--font-display);
}
.btn-primary:hover{background:var(--blue-700);}

/* ---- Toast / Confirm ---- */
.toast{
  position:fixed;bottom:80px;left:50%;transform:translateX(-50%);
  background:var(--surface);border:1px solid var(--border);
  border-radius:999px;padding:10px 24px;font-size:13px;color:var(--text);
  font-family:var(--font-display);z-index:9999;
  box-shadow:0 4px 20px rgba(0,0,0,.4);
}
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);z-index:1000;}
.modal.hidden{display:none;}
.modal-content{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:24px;width:480px;max-width:90vw;
  max-height:90vh;overflow-y:auto;
}
.search-card{width:820px;}
.modal-top-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;}
.modal-top-row h3{font-family:var(--font-display);font-weight:500;font-size:19px;margin:0;}
.close-btn{background:none;border:none;color:var(--text-muted);font-size:24px;cursor:pointer;padding:0;line-height:1;}
.close-btn:hover{color:var(--text);}
.search-input-wrap{margin-bottom:16px;}
.search-input-wrap input{
  width:100%;background:var(--surface-2);border:1px solid var(--border);
  border-radius:999px;padding:12px 16px;font-size:14px;color:var(--text);
  font-family:var(--font-body);outline:none;transition:border-color .2s;box-sizing:border-box;
}
.search-input-wrap input:focus{border-color:var(--blue-600);}
.search-input-wrap input::placeholder{color:var(--text-muted);}
.search-results{display:flex;flex-direction:column;gap:8px;max-height:400px;overflow-y:auto;}
.search-user-card{
  display:flex;align-items:center;gap:12px;padding:12px;
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--radius-md);cursor:pointer;transition:background .15s;
}
.search-user-card:hover{background:var(--surface);}
.search-user-card img{width:40px;height:40px;border-radius:50%;flex-shrink:0;background:var(--surface);}
.search-user-info{flex:1;min-width:0;}
.search-user-info .name{font-family:var(--font-display);font-weight:500;font-size:13px;}
.search-user-info .username{font-size:12px;color:var(--text-muted);}
.search-user-info .bio{font-size:11px;color:var(--text-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.search-empty{text-align:center;color:var(--text-muted);padding:40px;font-size:14px;}

/* ---- Skeletons ---- */
.pp-skeleton{padding:20px 0;}
.pp-skeleton-header{display:flex;align-items:flex-start;gap:30px;padding:20px 0;}
.pp-skeleton-avatar{width:80px;height:80px;flex-shrink:0;}
.pp-skeleton-info{flex:1;display:flex;flex-direction:column;gap:10px;padding-top:8px;}
.pp-skeleton-name{height:20px;width:180px;}
.pp-skeleton-username{height:14px;width:120px;}
.pp-skeleton-stats{display:flex;gap:20px;margin-top:8px;}
.pp-skeleton-stat{height:14px;width:60px;border-radius:6px;}
.pp-skeleton-bio{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--border);margin-top:16px;}
.pp-skeleton-posts{display:flex;flex-direction:column;gap:1px;padding-top:16px;border-top:1px solid var(--border);margin-top:16px;}
.pp-skeleton-post{padding:16px 0;border-bottom:1px solid var(--border);}
.pp-skeleton-post-line{height:14px;border-radius:6px;margin-bottom:8px;}
.pp-skeleton-post-date{height:12px;width:140px;border-radius:6px;margin-top:6px;}
@media(max-width:768px){
  .pp-skeleton-header{gap:20px;padding:16px 0;}
  .pp-skeleton-avatar{width:64px;height:64px;}
}
@media(max-width:480px){
  .pp-skeleton-header{flex-direction:column;align-items:center;}
}

/* ---- Bottom bar (mobile) ---- */
@media(max-width:768px){
  .bottom-bar{
    display:flex;align-items:center;justify-content:space-around;
    position:fixed;bottom:0;left:0;right:0;
    background:var(--surface);border-top:1px solid var(--border);
    padding:8px 0 max(8px,env(safe-area-inset-bottom));
    z-index:100;
  }
  .bb-btn{
    background:none;border:none;color:var(--text-muted);
    width:44px;height:44px;display:flex;align-items:center;justify-content:center;
    border-radius:50%;cursor:pointer;position:relative;
  }
  .bb-btn:hover{background:var(--surface-2);}
  .bb-primary{
    background:var(--blue-600);color:#fff;width:48px;height:48px;
    border-radius:50%;
  }
  .bb-primary:hover{background:var(--blue-700);}
  .bb-avatar{width:24px;height:24px;border-radius:50%;object-fit:cover;}
  .bb-user-wrap{position:relative;}
  .bb-menu{
    position:absolute;bottom:56px;right:0;
    background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-md);padding:6px;min-width:160px;
    box-shadow:0 8px 32px rgba(0,0,0,.5);z-index:110;
  }
  .user-menu-item{
    display:flex;align-items:center;gap:8px;width:100%;
    background:none;border:none;color:var(--text);
    padding:10px 14px;border-radius:var(--radius-sm);
    font-size:13px;cursor:pointer;font-family:var(--font-body);
    text-align:left;
  }
  .user-menu-item:hover{background:var(--surface-2);}
  .profile-main{padding-bottom:80px;}
  .pp-header-inner{gap:20px;padding:16px 0;}
  .pp-avatar{width:64px;height:64px;}
  .pp-header-top h2{font-size:18px;}
  .pp-stats{gap:16px;font-size:13px;}
  .search-card{width:96vw;}
  .modal-content{padding:16px;}
}

@media(max-width:480px){
  .pp-header-inner{flex-direction:column;align-items:center;text-align:center;gap:16px;}
  .pp-header-top{justify-content:center;}
  .pp-stats{justify-content:center;}
  .pp-bio-section{text-align:left;}
  .pp-links{justify-content:center;}
  .pp-joined{justify-content:center;}
}
