.topbar-notice-button {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.topbar-notice-button > .icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  transform: none;
}

.topbar-notice-button > span:not(.icon) {
  top: 2px;
  right: 1px;
  margin: 0;
}

.notification-peek-layer {
  position: fixed;
  z-index: 1400;
  inset: 0 0 auto;
  height: 0;
  pointer-events: none;
}

.notification-peek-layer .notification-peek-backdrop {
  display: none !important;
}

.notification-peek {
  position: absolute;
  top: calc(var(--topbar-height, 64px) + 8px);
  right: max(16px, calc((100vw - 1180px) / 2));
  display: grid;
  width: min(620px, calc(100vw - 32px));
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgb(255 255 255 / 97%);
  padding: 5px 7px;
  box-shadow: 0 10px 28px rgb(18 38 28 / 14%);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.notification-peek-label {
  display: none;
}

.notification-peek-label .icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}

.notification-peek .notification-peek-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 3px 6px;
  text-align: left;
}

.notification-peek .notification-peek-row:hover,
.notification-peek .notification-peek-row:focus-visible {
  background: var(--surface-subtle);
}

.notification-peek .notification-type-icon {
  display: grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  line-height: 0;
}

.notification-peek .notification-type-icon .icon {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
}

/* The archive uses the same optical center as the compact preview. */
.notification-list {
  gap: 18px;
  overflow: visible;
  border-block: 0;
}

.notification-group > h3 {
  margin: 0 0 7px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.notification-group > div {
  overflow: hidden;
  border-block: 1px solid var(--border);
}

.notification-card {
  min-height: 56px;
  grid-template-columns: 32px minmax(0, 1fr) 8px 18px;
  gap: 9px;
  padding: 7px 6px 7px 4px;
}

.notification-card .notification-type-icon {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  border-radius: 9px;
  line-height: 0;
}

.notification-card .notification-type-icon .icon,
.notification-card > .icon:last-child {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
}

.notification-card > .icon:last-child {
  justify-self: center;
}

.notification-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  align-content: center;
}

.notification-copy strong,
.notification-copy small {
  margin: 0;
  line-height: 1.35;
}

.notification-peek .notification-peek-row > .icon:last-child {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
  justify-self: center;
}

.notification-peek .notification-peek-row > span:nth-child(2) {
  min-width: 0;
}

.notification-peek .notification-peek-row strong,
.notification-peek .notification-peek-row small {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-peek .notification-peek-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.notification-peek .notification-peek-row small {
  margin-left: 7px;
  color: var(--text-2);
  font-size: 11px;
}

.notification-peek-archive {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  padding: 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.notification-peek-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-2);
}

.notification-peek-alert,
.notification-peek .notification-peek-empty,
.notification-peek .notification-peek-loading {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.notification-peek-alert span,
.notification-peek .notification-peek-empty span {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .notification-peek {
    top: calc(56px + env(safe-area-inset-top) + 6px);
    right: 8px;
    left: 8px;
    width: auto;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto 32px;
    gap: 5px;
    padding: 4px 5px 4px 7px;
  }

  .notification-peek .notification-peek-row {
    min-height: 34px;
    grid-template-columns: 22px minmax(0, 1fr) 14px;
    gap: 6px;
    padding-inline: 4px;
  }

  .notification-peek .notification-type-icon {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
  }

  .notification-peek .notification-peek-row strong {
    display: block;
    font-size: 12px;
  }

  .notification-peek .notification-peek-row small {
    display: none;
  }

  .notification-peek-archive {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .notification-peek-close {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .notification-card {
    grid-template-columns: 30px minmax(0, 1fr) 7px 16px;
    gap: 8px;
    padding-inline: 2px;
  }

  .notification-card .notification-type-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-peek {
    animation: none !important;
  }
}
