/* Facebook-style notification center and the compact header bell. */
.notification-bell-button {
  position: relative;
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

#notificationsBtn {
  order: 3;
}

.notification-bell-button:hover,
.notification-bell-button:focus-visible {
  background: rgba(255, 255, 255, .16);
}

.notification-bell-button:active {
  transform: scale(.96);
}

.notification-bell-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 2px 5px;
  border: 2px solid #0962D6;
  border-radius: 999px;
  background: #FF3B30;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  animation: notification-badge-pop .2s ease-out;
}

.notification-badge[hidden] {
  display: none !important;
}

@keyframes notification-badge-pop {
  from { opacity: 0; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}

.notification-center[hidden] {
  display: none !important;
}

.notification-center {
  position: fixed;
  inset: calc(var(--cid-shell-header-height) + env(safe-area-inset-top, 0px))
         0
         calc(var(--cid-shell-footer-height) + env(safe-area-inset-bottom, 0px))
         0;
  z-index: 1400;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
  background: #f0f2f5;
  backdrop-filter: none;
}

.notification-dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 510px);
  max-height: 100%;
  overflow: hidden;
  border: 1px solid #e4e6eb;
  border-radius: 0;
  background: #fff;
  color: #1c1e21;
  box-shadow: none;
  animation: notification-dialog-in .2s ease-out both;
}

@keyframes notification-dialog-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body.notification-center-open {
  overflow: hidden;
}

.notification-center-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid #e4e6eb;
  background: #fff;
}

.notification-center-header h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.notification-route-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.notification-center-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.notification-mark-all,
.notification-close {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.notification-mark-all {
  padding: 7px 5px;
  margin-left: auto;
  color: #1877f2;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.notification-mark-all:disabled {
  color: #a7adb5;
  cursor: default;
}

.notification-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  color: #65676b;
  font-size: 24px;
  line-height: 1;
}

.notification-close:hover,
.notification-close:focus-visible {
  background: #f0f2f5;
}

.notification-filters {
  display: flex;
  align-items: center;
  overflow-x: auto;
  gap: 6px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid #f0f2f5;
  background: #fff;
  scrollbar-width: none;
}
.notification-filters::-webkit-scrollbar { display: none; }

.notification-filter {
  min-height: 32px;
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #65676b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.notification-filter.is-active {
  background: #e7f3ff;
  color: #1877f2;
}

.notification-list {
  min-height: 132px;
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 11px;
  padding: 12px 10px;
  border: 0;
  border-radius: 11px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: #f0f2f5;
  outline: none;
}

.notification-item.is-unread {
  background: #eaf3ff;
}

.notification-item.is-unread:hover,
.notification-item.is-unread:focus-visible {
  background: #dfeeff;
}

.notification-type-icon {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 19px;
}

.notification-type-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-type-icon--reply,
.notification-type-icon--comment {
  background: #e7f3ff;
  color: #1877f2;
}

.notification-type-icon--admin {
  background: #fff0e6;
  color: #e05a00;
}

.notification-type-icon--message {
  background: #e8f0ff;
  color: #315fd5;
}

.notification-type-icon--reward {
  background: #fff4c7;
  color: #b77900;
}

.notification-type-icon--purchase {
  background: #e8f0ff;
  color: #245dbb;
  font-size: 20px;
  font-weight: 900;
}

.notification-type-icon--access {
  background: #e8f7ef;
  color: #16834d;
}

.notification-type-icon--promo {
  background: #fff3d8;
  color: #b97800;
}

.notification-type-icon--method {
  background: #e7f8ed;
  color: #16834d;
}

.notification-type-icon--info {
  background: #edf0f4;
  color: #536273;
}

.notification-item-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.notification-item-title {
  display: block;
  margin-bottom: 2px;
  color: #1c1e21;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.notification-item-message {
  display: -webkit-box;
  overflow: hidden;
  color: #4b4f56;
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  color: #8a919b;
  font-size: 10px;
  font-weight: 700;
}

.notification-kind-label {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf0f4;
  color: #536273;
  font-size: 9px;
  font-weight: 900;
}
.notification-kind-label--referral,
.notification-kind-label--reward {
  background: #fff4c7;
  color: #9a6500;
}
.notification-kind-label--purchase {
  background: #e8f0ff;
  color: #245dbb;
}
.notification-kind-label--access {
  background: #e8f7ef;
  color: #16834d;
}

.notification-unread-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 16px;
  border-radius: 50%;
  background: #1877f2;
}

.notification-empty {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  gap: 5px;
  padding: 28px;
  color: #65676b;
  text-align: center;
}

.notification-empty[hidden] {
  display: none !important;
}

.notification-empty strong {
  color: #1c1e21;
  font-size: 14px;
}

.notification-empty span:last-child {
  font-size: 12px;
}

.notification-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #e7f8ed;
  color: #16834d;
  font-size: 21px;
  font-weight: 900;
}

.notification-detail {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 22px 16px;
  background: rgba(240, 242, 245, .86);
  backdrop-filter: blur(5px);
}

.notification-detail-card {
  position: relative;
  width: min(100%, 460px);
  margin-top: 10px;
  padding: 22px;
  border: 1px solid #e4e6eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  animation: notification-detail-in .18s ease-out both;
}

@keyframes notification-detail-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.notification-detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f0f2f5;
  color: #536273;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.notification-detail-close:hover,
.notification-detail-close:focus-visible { background: #e4e6eb; }

.notification-detail-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-right: 25px;
}

.notification-detail-heading .notification-type-icon {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
}

.notification-detail-kicker {
  display: block;
  margin: 1px 0 4px;
  color: #7a8490;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-detail-heading h2 {
  margin: 0;
  color: #1c1e21;
  font-size: 18px;
  line-height: 1.28;
}

.notification-detail-message {
  margin: 20px 0 0;
  color: #3d4652;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.notification-detail-facts {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr);
  gap: 0;
  margin: 18px 0 0;
  border-top: 1px solid #edf0f4;
}

.notification-detail-facts dt,
.notification-detail-facts dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f4;
  font-size: 11px;
  line-height: 1.4;
}

.notification-detail-facts dt {
  color: #7a8490;
  font-weight: 800;
}

.notification-detail-facts dd {
  color: #1c1e21;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.notification-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.notification-detail-actions button {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.notification-detail-secondary {
  border: 1px solid #e1e7f0;
  background: #fff;
  color: #536273;
}

.notification-detail-primary {
  border: 1px solid #1877f2;
  background: #1877f2;
  color: #fff;
}

.notification-detail-actions button:focus-visible {
  outline: 3px solid rgba(24, 119, 242, .24);
  outline-offset: 2px;
}

.notification-target-highlight {
  animation: notification-target-highlight 1.5s ease both;
}

@keyframes notification-target-highlight {
  0%, 100% { box-shadow: 0 2px 8px rgba(28, 30, 33, .08); }
  35% { box-shadow: 0 0 0 4px rgba(24, 119, 242, .22), 0 8px 24px rgba(24, 119, 242, .18); }
}

@media (max-width: 600px) {
  .notification-center {
    align-items: stretch;
    inset: calc(var(--cid-shell-header-height) + env(safe-area-inset-top, 0px))
           0
           calc(var(--cid-shell-footer-height) + env(safe-area-inset-bottom, 0px))
           0;
    padding: 0;
  }

  .notification-dialog {
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .notification-center-header {
    min-height: 48px;
    padding: 9px 15px 7px;
  }

  .notification-mark-all {
    max-width: none;
    text-align: right;
  }

  .notification-list {
    padding: 8px 10px 24px;
  }

  .notification-detail {
    align-items: stretch;
    padding: 12px;
  }

  .notification-detail-card {
    width: 100%;
    margin: 0;
    align-self: flex-start;
    padding: 18px 16px;
  }

  .notification-bell-button {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    margin-left: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-dialog,
  .notification-badge {
    animation-duration: 1ms;
  }
}
