.pd-notif-wrap{ position:relative; flex-shrink:0; }
.pd-notif-bell{
  position:relative;
  width:40px;
  height:40px;
  border:1px solid #dfe1e5;
  border-radius:999px;
  background:#fff;
  color:#202124;
  cursor:pointer;
  display:grid;
  place-items:center;
  padding:0;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pd-notif-bell:hover{ background:#f1f3f4; border-color:#c7dcff; }
.pd-notif-bell-count{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#d93025;
  color:#fff;
  border:2px solid #fff;
  font-size:10px;
  font-weight:700;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
}
.pd-notif-bell-count[hidden]{ display:none!important; }
.pd-notif-panel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:min(400px, calc(100vw - 24px));
  max-height:min(560px, 78vh);
  overflow:hidden;
  display:none;
  flex-direction:column;
  background:#fff;
  border:1px solid #dddfe2;
  border-radius:12px;
  box-shadow:0 12px 28px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
  z-index:500;
}
.pd-notif-wrap.pd-notif-open .pd-notif-panel{ display:flex; }
.pd-notif-panel[hidden]{ display:none!important; }
.pd-notif-panel-top{
  flex-shrink:0;
  padding:12px 16px 0;
  border-bottom:1px solid #e4e6eb;
  background:#fff;
}
.pd-notif-panel-actions{ display:flex; align-items:center; gap:4px; }
.pd-notif-close{
  width:32px;
  height:32px;
  border:none;
  border-radius:999px;
  background:#e4e6eb;
  color:#050505;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  padding:0;
}
.pd-notif-close:hover{ background:#d8dadf; }
.pd-notif-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 0 10px;
}
.pd-notif-panel-title{
  font-size:24px;
  font-weight:700;
  color:#050505;
  letter-spacing:-.02em;
}
.pd-notif-mark-all{
  border:none;
  background:transparent;
  color:#1877f2;
  font:inherit;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  padding:6px 8px;
  border-radius:6px;
  white-space:nowrap;
}
.pd-notif-mark-all:hover{ background:#e7f3ff; }
.pd-notif-filters{
  display:flex;
  gap:8px;
  padding:0 0 12px;
  overflow-x:auto;
}
.pd-notif-filter{
  flex-shrink:0;
  border:none;
  border-radius:999px;
  padding:8px 14px;
  font:inherit;
  font-size:15px;
  font-weight:600;
  color:#050505;
  background:#e4e6eb;
  cursor:pointer;
  transition:background .15s ease, color .15s ease;
}
.pd-notif-filter:hover{ background:#d8dadf; }
.pd-notif-filter.active{
  background:#1877f2;
  color:#fff;
}
.pd-notif-list-wrap{
  flex:1;
  min-height:0;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
}
.pd-notif-list{
  display:flex;
  flex-direction:column;
}
.pd-notif-section{ padding-bottom:4px; }
.pd-notif-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 16px 6px;
  font-size:17px;
  font-weight:700;
  color:#050505;
}
.pd-notif-empty{
  padding:28px 16px;
  text-align:center;
  font-size:15px;
  color:#65676b;
}
.pd-notif-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  width:100%;
  text-align:left;
  border:none;
  border-radius:0;
  padding:10px 16px;
  background:transparent;
  cursor:pointer;
  font:inherit;
  color:inherit;
  position:relative;
}
.pd-notif-item:hover{ background:#f2f3f5; }
.pd-notif-item:active{ background:#e4e6eb; }
.pd-notif-item-av-wrap{
  position:relative;
  flex-shrink:0;
  width:40px;
  height:40px;
}
.pd-notif-item-av{
  width:40px;
  height:40px;
  border-radius:999px;
  background:linear-gradient(180deg,#eaebef,#dfe3e8);
  border:1px solid #ccd0d5;
  display:grid;
  place-items:center;
  font-size:15px;
  font-weight:700;
  color:#050505;
  overflow:hidden;
}
.pd-notif-item-av-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.pd-notif-item-badge{
  position:absolute;
  right:-2px;
  bottom:-2px;
  width:18px;
  height:18px;
  border-radius:999px;
  border:2px solid #fff;
  display:grid;
  place-items:center;
  color:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.15);
}
.pd-notif-item-badge svg{ width:9px; height:9px; }
.pd-notif-item-badge--like{ background:#1877f2; }
.pd-notif-item-badge--comment{ background:#1877f2; }
.pd-notif-item-badge--default{ background:#65676b; }
.pd-notif-item-body{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-top:2px;
  padding-right:8px;
}
.pd-notif-item-text{
  font-size:15px;
  line-height:1.35;
  color:#050505;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.pd-notif-item-name{
  font-weight:700;
  color:#050505;
}
.pd-notif-item-action{
  font-weight:400;
  color:#050505;
}
.pd-notif-item-time{
  font-size:13px;
  color:#65676b;
  font-weight:400;
}
.pd-notif-item-dot{
  flex-shrink:0;
  width:12px;
  height:12px;
  border-radius:999px;
  background:#1877f2;
  margin-top:8px;
}
/* ยังไม่อ่าน = ทึบเข้ม | อ่านแล้ว = สว่างจาง */
.pd-notif-item--unread{
  background:#e7f3ff;
}
.pd-notif-item--unread .pd-notif-item-text,
.pd-notif-item--unread .pd-notif-item-name,
.pd-notif-item--unread .pd-notif-item-action{
  color:#050505;
  font-weight:600;
}
.pd-notif-item--unread .pd-notif-item-time{
  color:#4b4f56;
  font-weight:500;
}
.pd-notif-item--read{
  background:transparent;
  opacity:1;
}
.pd-notif-item--read .pd-notif-item-text,
.pd-notif-item--read .pd-notif-item-name,
.pd-notif-item--read .pd-notif-item-action{
  color:#8a8d91;
  font-weight:400;
}
.pd-notif-item--read .pd-notif-item-time{
  color:#b0b3b8;
  font-weight:400;
}
.pd-notif-item--read .pd-notif-item-av{
  opacity:.88;
}

/* ไฮไลต์การ์ดเมื่อกดจากแจ้งเตือน */
.feed-card.feed-card--flash{
  box-shadow:0 0 0 3px rgba(26,115,232,.4);
  border-color:#1a73e8!important;
  transition:box-shadow .25s ease, border-color .25s ease;
}

/* Popup ดูโพสต์จากแจ้งเตือน (สไตล์ Facebook) */
.pd-notif-preview{
  position:fixed;
  inset:0;
  z-index:20100;
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(244,244,244,.75);
  backdrop-filter:blur(6px);
}
.pd-notif-preview.show{ display:flex; }
.pd-notif-preview-dialog{
  width:min(500px,100%);
  max-height:min(88vh,720px);
  display:flex;
  flex-direction:column;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 12px 28px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.08);
  animation:pdNotifPopIn .22s ease;
}
@keyframes pdNotifPopIn{
  from{ opacity:0; transform:scale(.96) translateY(8px); }
  to{ opacity:1; transform:scale(1) translateY(0); }
}
.pd-notif-preview-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid #e4e6eb;
}
.pd-notif-preview-head h2{
  margin:0;
  font-size:20px;
  font-weight:700;
  color:#050505;
  letter-spacing:-.02em;
}
.pd-notif-preview-close{
  width:36px;
  height:36px;
  border:none;
  border-radius:999px;
  background:#e4e6eb;
  color:#050505;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.pd-notif-preview-close:hover{ background:#d8dadf; }
.pd-notif-preview-body{
  flex:1;
  overflow-y:auto;
  padding:12px 16px 16px;
  background:#f0f2f5;
}
.pd-notif-preview-alert{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px 14px;
  margin-bottom:12px;
  border-radius:10px;
  background:#fff;
  border:1px solid #e4e6eb;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.pd-notif-preview-alert-ico{
  width:40px;
  height:40px;
  border-radius:999px;
  background:#e7f3ff;
  display:grid;
  place-items:center;
  font-size:20px;
  flex-shrink:0;
}
.pd-notif-preview-alert-text{
  font-size:15px;
  font-weight:600;
  color:#050505;
  line-height:1.35;
}
.pd-notif-preview-alert-sub{
  font-size:13px;
  color:#65676b;
  margin-top:4px;
  font-weight:400;
}
.pd-notif-preview-card{
  background:#fff;
  border-radius:10px;
  border:1px solid #e4e6eb;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  overflow:hidden;
}
.pd-notif-preview-card-head{
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 14px 0;
}
.pd-notif-preview-avatar{
  width:40px;
  height:40px;
  border-radius:999px;
  background:linear-gradient(135deg,#e8f2ff,#c7dcff);
  color:#1a73e8;
  font-weight:700;
  font-size:16px;
  display:grid;
  place-items:center;
  flex-shrink:0;
}
.pd-notif-preview-card-meta{ min-width:0; }
.pd-notif-preview-card-name{ font-size:15px; font-weight:600; color:#050505; }
.pd-notif-preview-card-time{ font-size:12px; color:#65676b; margin-top:2px; }
.pd-notif-preview-card-text{
  padding:10px 14px 12px;
  font-size:15px;
  line-height:1.45;
  color:#050505;
  white-space:pre-wrap;
  word-break:break-word;
}
.pd-notif-preview-card-details{
  padding:0 14px 12px;
  font-size:13px;
  color:#65676b;
  line-height:1.5;
  white-space:pre-wrap;
}
.pd-notif-preview-comments{
  margin-top:12px;
  background:#fff;
  border-radius:10px;
  border:1px solid #e4e6eb;
  overflow:hidden;
}
.pd-notif-preview-comments-head{
  padding:10px 14px;
  font-size:13px;
  font-weight:600;
  color:#65676b;
  border-bottom:1px solid #e4e6eb;
  background:#f7f8fa;
}
.pd-notif-preview-comment{
  display:flex;
  gap:8px;
  padding:10px 14px;
  border-bottom:1px solid #f0f2f5;
}
.pd-notif-preview-comment:last-child{ border-bottom:none; }
.pd-notif-preview-comment-av{
  width:28px;
  height:28px;
  border-radius:999px;
  background:#e4e6eb;
  font-size:11px;
  font-weight:700;
  color:#65676b;
  display:grid;
  place-items:center;
  flex-shrink:0;
}
.pd-notif-preview-comment-body{ min-width:0; }
.pd-notif-preview-comment-name{ font-size:13px; font-weight:600; color:#050505; }
.pd-notif-preview-comment-text{
  font-size:14px;
  color:#050505;
  margin-top:2px;
  line-height:1.4;
  background:#f0f2f5;
  border-radius:12px;
  padding:8px 12px;
  display:inline-block;
  max-width:100%;
}
.pd-notif-preview-foot{
  display:flex;
  gap:8px;
  padding:12px 16px 16px;
  border-top:1px solid #e4e6eb;
  background:#fff;
}
.pd-notif-preview-btn{
  flex:1;
  height:40px;
  border-radius:8px;
  font:inherit;
  font-size:15px;
  font-weight:600;
  cursor:pointer;
  border:none;
}
.pd-notif-preview-btn--ghost{
  background:#e4e6eb;
  color:#050505;
}
.pd-notif-preview-btn--ghost:hover{ background:#d8dadf; }
.pd-notif-preview-btn--primary{
  background:#1877f2;
  color:#fff;
}
.pd-notif-preview-btn--primary:hover{ background:#166fe5; }

.pd-notif-panel--docked{
  position:fixed;
  top:calc(var(--pd-top-bar-h, 56px) + 8px);
  left:12px;
  right:12px;
  width:auto;
  max-width:400px;
  margin:0 auto;
  max-height:min(560px, calc(100vh - var(--pd-top-bar-h, 56px) - 24px));
  z-index:40000;
}
@media (max-width:1024px){
  .pd-notif-panel--docked{
    max-width:none;
  }
  .pd-notif-panel-top{
    padding:14px 16px 0;
  }
  .pd-notif-panel-title{
    font-size:20px;
  }
}
