/* Shared signed-in notification center ---------------------------------- */

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

.site-nav-notifications {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border-top: 1px solid var(--dc-border);
}

.site-nav-notifications[hidden] {
  display: none;
}

.notification-bell-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--dc-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--dc-radius-md);
}

.notification-bell-btn:hover,
.notification-bell-btn[aria-expanded="true"] {
  color: var(--dc-blue-bright);
  background: var(--dc-blue-soft);
  border-color: var(--dc-border);
}

.notification-bell-icon,
.notification-item-icon svg,
.notification-toast-icon svg,
.notification-empty > svg,
.notification-icon-btn svg,
.notification-toast-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-nav-label {
  position: absolute;
  left: 52px;
  top: 50%;
  z-index: 1;
  min-width: max-content;
  padding: 5px 8px;
  color: var(--dc-text);
  background: var(--dc-surface-raised);
  border: 1px solid var(--dc-border);
  border-radius: var(--dc-radius-sm);
  box-shadow: var(--dc-shadow);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.notification-bell-btn:hover .notification-nav-label,
.notification-bell-btn:focus-visible .notification-nav-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.notification-unread-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  color: #fff;
  background: var(--dc-red);
  border: 2px solid var(--dc-surface);
  border-radius: 999px;
  font-family: var(--dc-font-body);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.notification-scrim {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(0, 0, 0, 0.42);
  border: 0;
  cursor: default;
}

.notification-scrim:hover {
  background: rgba(0, 0, 0, 0.42);
  box-shadow: none;
  filter: none;
  transform: none;
}

.notification-scrim[hidden],
.notification-panel[hidden] {
  display: none;
}

.notification-panel {
  position: fixed;
  top: 14px;
  bottom: 14px;
  left: calc(var(--dc-rail-expanded) + 12px);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - var(--dc-rail-expanded) - 38px));
  min-height: 0;
  overflow: hidden;
  color: var(--dc-text);
  background: rgba(29, 29, 31, 0.99);
  border: 1px solid var(--dc-border-strong);
  border-radius: var(--dc-radius-lg);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.52);
  animation: notification-panel-in 190ms ease-out;
}

.notification-panel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--dc-border);
}

.notification-panel-heading {
  min-width: 0;
}

.notification-eyebrow {
  margin: 0 0 2px;
  color: var(--dc-blue-bright);
  font-family: var(--dc-font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.notification-panel h2 {
  margin: 0;
  font-family: var(--dc-font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.notification-icon-btn,
.notification-toast-close {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--dc-muted-strong);
  background: transparent;
  border: 1px solid var(--dc-border);
  border-radius: var(--dc-radius-md);
}

.notification-preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--dc-border);
  border-bottom: 1px solid var(--dc-border);
  cursor: pointer;
}

.notification-preference-row strong,
.notification-preference-row small {
  display: block;
}

.notification-preference-row small {
  margin-top: 4px;
  color: var(--dc-muted);
}

.notification-switch {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 44px;
}

.notification-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.notification-switch-track {
  position: absolute;
  top: 9px;
  left: 0;
  width: 52px;
  height: 26px;
  border: 1px solid var(--dc-border-strong);
  border-radius: 999px;
  background: var(--dc-surface-3);
  transition: background-color 150ms ease, border-color 150ms ease;
  pointer-events: none;
}

.notification-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dc-muted);
  transition: transform 150ms ease, background-color 150ms ease;
}

.notification-switch input:checked + .notification-switch-track {
  border-color: var(--dc-blue-bright);
  background: color-mix(in srgb, var(--dc-blue-bright) 28%, var(--dc-surface-3));
}

.notification-switch input:checked + .notification-switch-track::after {
  background: var(--dc-blue-bright);
  transform: translateX(26px);
}

.notification-switch input:focus-visible + .notification-switch-track {
  outline: 2px solid var(--dc-focus);
  outline-offset: 3px;
}

.notification-switch input:disabled + .notification-switch-track {
  opacity: 0.55;
}

.notification-icon-btn:hover,
.notification-toast-close:hover {
  color: var(--dc-text);
  background: rgba(255, 255, 255, 0.06);
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--dc-border);
}

.notification-filters {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--dc-surface-soft);
  border: 1px solid var(--dc-border);
  border-radius: var(--dc-radius-md);
}

.notification-filter,
.notification-mark-all,
.notification-read-toggle,
.notification-action,
.notification-retry {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: var(--dc-radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.notification-filter {
  color: var(--dc-muted);
  background: transparent;
  border: 0;
}

.notification-filter.is-active {
  color: var(--dc-text);
  background: var(--dc-surface-raised);
  box-shadow: var(--dc-shadow);
}

.notification-mark-all {
  color: var(--dc-blue-bright);
  background: transparent;
  border: 0;
}

.notification-mark-all:disabled {
  color: var(--dc-muted);
  opacity: 0.55;
}

.notification-status {
  min-height: 22px;
  margin: 0;
  padding: 10px 16px 7px;
  color: var(--dc-muted);
  font-size: 12px;
}

.notification-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 4px 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
  background: var(--dc-surface-soft);
  border: 1px solid var(--dc-border);
  border-radius: var(--dc-radius-md);
}

.notification-item.is-unread {
  background: linear-gradient(90deg, var(--dc-blue-soft), var(--dc-surface-soft) 42%);
  border-color: rgba(142, 172, 255, 0.35);
}

.notification-item.is-unread::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  background: var(--dc-blue-bright);
  border-radius: 0 3px 3px 0;
}

.notification-item-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--dc-blue-bright);
  background: var(--dc-blue-soft);
  border-radius: 50%;
}

.severity-success .notification-item-icon,
.notification-toast.severity-success .notification-toast-icon {
  color: var(--dc-green);
  background: rgba(74, 209, 126, 0.12);
}

.severity-warning .notification-item-icon,
.notification-toast.severity-warning .notification-toast-icon {
  color: var(--dc-amber);
  background: rgba(229, 202, 126, 0.12);
}

.notification-item-content {
  min-width: 0;
}

.notification-item-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.notification-item h3 {
  margin: 0;
  color: var(--dc-text);
  font-size: 14px;
  line-height: 1.25;
}

.notification-item time {
  flex: 0 0 auto;
  color: var(--dc-muted);
  font-size: 11px;
}

.notification-item-message {
  margin: 5px 0 0;
  color: var(--dc-muted-strong);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.notification-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.notification-action {
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--dc-blue);
  border: 1px solid var(--dc-blue);
}

.notification-action:hover {
  color: #fff;
  background: #4d74e8;
}

.notification-read-toggle,
.notification-retry {
  color: var(--dc-muted-strong);
  background: transparent;
  border: 1px solid var(--dc-border);
}

.notification-read-toggle:hover,
.notification-retry:hover {
  color: var(--dc-text);
  background: rgba(255, 255, 255, 0.05);
}

.notification-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 230px;
  padding: 28px;
  color: var(--dc-muted);
  text-align: center;
}

.notification-empty > svg {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  color: var(--dc-blue-bright);
}

.notification-empty strong {
  color: var(--dc-text);
}

.notification-empty p {
  max-width: 270px;
  margin: 0;
  font-size: 13px;
}

.notification-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.notification-toast {
  padding: 13px;
  color: var(--dc-text);
  background: rgba(35, 35, 38, 0.99);
  border: 1px solid var(--dc-border-strong);
  border-radius: var(--dc-radius-md);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  pointer-events: auto;
  animation: notification-toast-in 180ms ease-out;
}

.notification-toast-top {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
}

.notification-toast-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--dc-blue-bright);
  background: var(--dc-blue-soft);
  border-radius: 50%;
}

.notification-toast-close {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border: 0;
}

.notification-toast-close svg {
  width: 16px;
  height: 16px;
}

.notification-toast-message {
  margin: 7px 0 9px 38px;
  color: var(--dc-muted-strong);
  font-size: 13px;
  line-height: 1.4;
}

.notification-toast > .notification-action {
  margin-left: 38px;
}

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

@keyframes notification-panel-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

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

@media (min-width: 761px) and (hover: hover) {
  .site-nav.notifications-open {
    width: var(--dc-rail-expanded);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.45);
  }

  .site-nav.notifications-open .site-nav-title,
  .site-nav.notifications-open .site-nav-label,
  .site-nav.notifications-open .notification-nav-label {
    opacity: 1;
  }

  .site-nav.notifications-open .notification-nav-label {
    position: static;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 13px;
    transform: none;
  }

  .site-nav:hover .notification-nav-label,
  .site-nav:focus-within .notification-nav-label {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip: auto;
    opacity: 1;
    transform: none;
    color: inherit;
    background: transparent;
    border: 0;
    box-shadow: none;
    white-space: nowrap;
  }

  .site-nav-notifications {
    justify-content: flex-start;
  }

  .site-nav-notifications .notification-bell-btn {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    justify-items: start;
  }

  .site-nav-notifications .notification-bell-icon {
    justify-self: center;
  }
}

@media (max-width: 760px) {
  /* The account avatar/menu already owns Account on signed-in mobile. Removing
     the duplicate link keeps the bottom navigation at five controls. */
  .site-nav.notifications-signed-in .site-nav-links .site-nav-link[href="account.html"] {
    display: none;
  }

  .site-nav-notifications {
    flex: 0 0 54px;
    width: 54px;
    min-width: 54px;
    min-height: var(--dc-mobile-nav-height);
    padding: 0;
    border-top: 0;
    border-left: 1px solid var(--dc-border);
  }

  .notification-bell-btn {
    grid-template-rows: 24px auto;
    gap: 3px;
    width: 100%;
    height: 100%;
    min-height: var(--dc-mobile-nav-height);
    padding: 7px 4px 5px;
    border: 0;
    border-radius: 0;
  }

  .notification-nav-label {
    position: static;
    min-width: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 10px;
    line-height: 1;
    opacity: 1;
    transform: none;
  }

  .notification-unread-badge {
    top: 4px;
    right: calc(50% - 22px);
  }

  .notification-scrim {
    bottom: var(--dc-mobile-nav-height);
    height: auto;
    background: rgba(0, 0, 0, 0.58);
  }

  .notification-panel {
    inset: auto 0 var(--dc-mobile-nav-height);
    width: 100%;
    max-height: min(72dvh, 660px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    animation-name: notification-sheet-in;
  }

  .notification-panel-header {
    padding-top: 15px;
  }

  .notification-panel-header::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 40px;
    height: 4px;
    background: var(--dc-border-strong);
    border-radius: 999px;
    transform: translateX(-50%);
  }

  .notification-toolbar {
    align-items: stretch;
  }

  .notification-filter,
  .notification-mark-all {
    min-height: 44px;
  }

  .notification-toasts {
    right: 10px;
    bottom: calc(var(--dc-mobile-nav-height) + 10px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
  }

  .notification-read-toggle,
  .notification-action,
  .notification-retry {
    min-height: 44px;
  }
}

@keyframes notification-sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-panel,
  .notification-toast {
    animation: none;
  }

  .notification-nav-label {
    transition: none;
  }
}
