/* Notifications bell, dropdown, list page, settings.
   Colours come from tokens.css only, so light and graphite-dark both work.
   Open/close follows the profile-menu convention (visibility + opacity/transform
   transition, see motion.css); fetched content gets .motion-enter from JS. */

.notif-bell {
  position: relative;
}

.notif-bell__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--mshp-surface-2);
  color: var(--mshp-text);
  border: 1px solid var(--mshp-line);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.notif-bell__button:hover,
.notif-bell.is-open .notif-bell__button {
  background: var(--mshp-surface-3);
  border-color: var(--mshp-line-strong);
}

.notif-bell__button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--mshp-sky);
}

.notif-bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  background: var(--color-danger-solid);
  color: var(--color-on-primary);
  border: 2px solid var(--color-header-bg);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.notif-bell__badge[hidden] {
  display: none;
}

.notif-bell__badge.is-bumped {
  animation: mshp-pop-in var(--motion-base) var(--ease-enter) both;
}

.notif-panel {
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transform-origin: top right;
  transition:
    opacity var(--motion-fast) var(--ease-exit),
    transform var(--motion-fast) var(--ease-exit),
    visibility 0s linear var(--motion-fast);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  background: var(--mshp-paper);
  border: 1px solid var(--mshp-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 60;
  overflow: hidden;
}

.notif-bell.is-open .notif-panel {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity var(--motion-base) var(--ease-enter),
    transform var(--motion-base) var(--ease-enter),
    visibility 0s;
}

.notif-panel__head,
.notif-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 12px 16px;
}

.notif-panel__head {
  border-bottom: 1px solid var(--mshp-line);
}

.notif-panel__foot {
  border-top: 1px solid var(--mshp-line);
  font-size: 0.875rem;
}

.notif-panel__foot a {
  color: var(--mshp-sky-dark);
  font-weight: 700;
  text-decoration: none;
}

.notif-panel__foot a:hover {
  text-decoration: underline;
}

.notif-panel__title {
  margin: 0;
  font-size: 1rem;
}

.notif-panel__read-all {
  background: none;
  border: 0;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  color: var(--mshp-sky-dark);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.notif-panel__read-all:hover {
  background: var(--mshp-surface-2);
}

.notif-panel__read-all:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.notif-panel__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0;
  min-height: 72px;
}

.notif-panel__body .skeleton {
  padding: 12px 16px;
}

.notif-panel__empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  color: var(--mshp-muted);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-item__link {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  color: var(--mshp-text-body);
  text-decoration: none;
}

.notif-item__link:hover,
.notif-item__link:focus-visible {
  background: var(--mshp-surface-2);
  outline: none;
}

.notif-item__link:focus-visible {
  box-shadow: inset 0 0 0 2px var(--mshp-sky);
}

.notif-item__dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}

.notif-item.is-unread .notif-item__dot {
  background: var(--mshp-sky);
}

.notif-item__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notif-item__title {
  color: var(--mshp-text);
  font-weight: 600;
  line-height: 1.3;
}

.notif-item.is-unread .notif-item__title {
  font-weight: 800;
}

.notif-item__count {
  color: var(--mshp-muted-strong);
  font-weight: 700;
  font-size: 0.8125rem;
}

.notif-item__body {
  color: var(--mshp-muted-strong);
  font-size: 0.875rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-item__time {
  color: var(--mshp-muted);
  font-size: 0.75rem;
}

.notif-list--page {
  background: var(--mshp-paper);
  border: 1px solid var(--mshp-line);
  border-radius: var(--radius-lg);
  padding: 4px 0;
}

.notif-list--page .notif-item + .notif-item {
  border-top: 1px solid var(--mshp-line);
}

.notif-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.notif-settings__group {
  border: 0;
  margin: 0 0 var(--space-4);
  padding: 0;
}

.notif-settings__group legend {
  font-weight: 800;
  color: var(--mshp-text);
  margin-bottom: var(--space-2);
}

.notif-settings__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-weight: 500;
}

.notif-settings__row input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--mshp-sky);
}

@media (max-width: 640px) {
  .notif-panel {
    position: fixed;
    top: calc(var(--site-header-h, 64px) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notif-panel,
  .notif-bell.is-open .notif-panel {
    transition: none;
    transform: none;
  }
}
