.notification-control {
  position: relative;
}

.notification-button {
  position: relative;
}

.notification-button.has-unread {
  border-color: rgba(107, 65, 24, .62);
  background: rgba(251, 231, 180, .72);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #ead29d;
  border-radius: 10px;
  color: #fff8e6;
  background: #8b3f2d;
  box-shadow: 0 2px 6px rgba(54, 28, 16, .3);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.notification-badge[hidden],
.notification-center[hidden] {
  display: none;
}

.notification-center {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  width: min(390px, calc(100vw - 26px));
  max-height: min(590px, calc(100vh - 96px));
  overflow: hidden;
  border: 1px solid rgba(83, 59, 26, .46);
  border-radius: 16px;
  color: #3f3221;
  background:
    linear-gradient(rgba(245, 229, 193, .98), rgba(231, 206, 158, .99)),
    url('/assets/images/parchment.png') center / 480px;
  box-shadow: 0 18px 48px rgba(53, 36, 17, .32), inset 0 0 0 3px rgba(255, 244, 216, .25);
}

.notification-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 19px 14px;
  border-bottom: 1px solid rgba(91, 65, 30, .18);
}

.notification-header .eyebrow {
  margin: 0 0 2px;
  color: #8b6c3f;
  font-size: 9px;
}

.notification-header h2 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 500;
}

.notification-mark-all {
  padding: 5px 0;
  color: #5c552e;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.notification-mark-all:disabled {
  opacity: .44;
  cursor: default;
}

.notification-list {
  max-height: min(510px, calc(100vh - 166px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(91, 65, 30, .14);
  background: rgba(255, 246, 221, .12);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.is-unread {
  background: rgba(255, 247, 221, .5);
}

.notification-item.is-unread::before {
  position: absolute;
  top: 19px;
  left: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b3f2d;
  content: '';
}

.notification-type {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(84, 85, 48, .28);
  border-radius: 50%;
  color: #596039;
  background: rgba(142, 147, 87, .18);
  font-family: Georgia, serif;
  font-size: 18px;
}

.notification-type-invitation {
  color: #785325;
  background: rgba(174, 126, 55, .2);
}

.notification-copy h3 {
  margin: 0 0 3px;
  font-size: 12px;
  line-height: 1.35;
}

.notification-copy p {
  margin: 0 0 6px;
  color: #6d5a3d;
  font-size: 10px;
  line-height: 1.45;
}

.notification-copy time {
  display: block;
  color: #897250;
  font-size: 9px;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
}

.notification-actions a,
.notification-actions button,
.notification-state button {
  padding: 0;
  border: 0;
  color: #596039;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.notification-actions a:hover,
.notification-actions button:hover,
.notification-state button:hover {
  text-decoration: underline;
}

.notification-actions .notification-dismiss {
  color: #815947;
}

.notification-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 28px;
  color: #6a583d;
  text-align: center;
}

.notification-state::before {
  margin-bottom: 10px;
  color: #7b7a48;
  font-family: Georgia, serif;
  font-size: 28px;
  content: '❧';
}

.notification-state strong {
  color: #443722;
  font-family: Georgia, serif;
  font-size: 15px;
}

.notification-state p {
  max-width: 240px;
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.45;
}

.notification-state button {
  margin-top: 13px;
}

.notification-state-loading::before {
  animation: notification-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes notification-pulse {
  to { opacity: .35; transform: translateY(-2px); }
}

@media (max-width: 700px) {
  .notification-center {
    position: fixed;
    top: 70px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 80px);
  }

  .notification-list {
    max-height: calc(100vh - 150px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-state-loading::before { animation: none; }
}
