
.notif-wrapper {
  position: relative;
}

#notifBtn {
  display: none;
}

.notif-panel {
  display: none !important;
}

.notif-dot {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--orange, #f59e0b);
  color: #fff;
  border-radius: 999px;
  border: 2px solid rgb(var(--bg));
  pointer-events: none;
  font-size: calc(.65rem * var(--ts, 1));
  font-weight: 700;
  line-height: 1;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
}

.notif-dot.notif-dot-show {
  display: flex;
}

.notif-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  overflow: hidden;
  overscroll-behavior: contain;
}

.notif-overlay.notif-overlay-show {
  display: flex;
  animation: notifOverlayFade .15s ease;
}

@keyframes notifOverlayFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body.notif-overlay-open {
  overflow: hidden;
}

.notif-overlay-inner {
  background: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  height: 100%;
  max-height: 680px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  animation: notifOverlayIn .2s cubic-bezier(.175, .885, .32, 1.05);
  user-select: none;
}

@keyframes notifOverlayIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notif-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgb(var(--border));
  flex-shrink: 0;
}

.notif-overlay-title {
  font-weight: 600;
  font-size: calc(1.05rem * var(--ts, 1));
  color: rgb(var(--fg));
}

.notif-overlay-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notif-overlay-mark {
  background: none;
  border: none;
  padding: .4rem .2rem;
  margin: -.4rem -.2rem;
  font-size: calc(.82rem * var(--ts, 1));
  color: rgb(var(--muted-fg));
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.notif-overlay-mark svg {
  width: calc(16px * var(--ui, 1) * var(--is, 1));
  height: calc(16px * var(--ui, 1) * var(--is, 1));
  flex-shrink: 0;
  display: none;
}

.notif-overlay-mark:hover {
  color: rgb(var(--primary));
}

.notif-overlay-mark:active {
  opacity: .7;
}

@media (max-width: 480px) {
  .notif-overlay-mark svg {
    display: block;
  }

  .notif-overlay-mark-text {
    display: none;
  }
}

.notif-overlay-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: rgb(var(--muted-fg));
  font-size: calc(1.5rem * var(--ts, 1));
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.notif-overlay-close:hover {
  background: rgb(var(--muted));
  color: rgb(var(--fg));
}

.notif-overlay-body {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 0;
}

@media (max-width: 680px) {
  .notif-overlay {
    padding: 0;
  }

  .notif-overlay-inner {
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .notif-overlay-body {
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
  }

  .notif-overlay-list,
  .notif-overlay-preview {
    grid-column: 1;
    grid-row: 1;
  }

  .notif-overlay-list {
    border-right: none;
  }

  .notif-overlay-preview {
    position: absolute;
    inset: 0;
    transform: translateX(100%);
    transition: transform .2s ease;
    background: rgb(var(--card));
  }

  .notif-overlay-body.notif-mobile-preview-active .notif-overlay-preview {
    transform: translateX(0);
  }

  .notif-overlay-body.notif-mobile-preview-active .notif-overlay-list {
    visibility: hidden;
  }

  .notif-overlay-preview .notif-preview-back {
    display: inline-flex;
  }
}

.notif-overlay-list {
  border-right: 1px solid rgb(var(--border));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  min-height: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgb(var(--border));
  color: rgb(var(--fg));
  font-size: calc(.875rem * var(--ts, 1));
  transition: background .15s;
  cursor: pointer;
}

.notif-item-animate {
  animation: notifItemIn .35s forwards;
}

@keyframes notifItemIn {
  from {
    opacity: 0;
    transform: translateX(6px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover,
.notif-item:focus-visible {
  background: rgb(var(--muted));
  outline: none;
}

.notif-item.notif-unread {
  background: rgba(14, 165, 233, .06);
}

.dark .notif-item.notif-unread {
  background: rgba(34, 211, 238, .05);
}

.notif-item.notif-item-active {
  background: rgba(14, 165, 233, .12);
}

.dark .notif-item.notif-item-active {
  background: rgba(34, 211, 238, .1);
}

.notif-item-icon-wrap {
  flex-shrink: 0;
  width: calc(20px * var(--ui, 1) * var(--is, 1));
  height: calc(20px * var(--ui, 1) * var(--is, 1));
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--muted-fg));
}

.notif-item-icon-img {
  width: calc(20px * var(--ui, 1) * var(--is, 1));
  height: calc(20px * var(--ui, 1) * var(--is, 1));
  border-radius: 6px;
  object-fit: cover;
}

.notif-item-icon-preset {
  width: calc(18px * var(--ui, 1) * var(--is, 1));
  height: calc(18px * var(--ui, 1) * var(--is, 1));
  display: inline-flex;
}

.notif-item-icon-preset svg {
  width: 100%;
  height: 100%;
}

.notif-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .4rem;
  line-height: 1.3;
}

.notif-unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--primary));
  flex-shrink: 0;
}

.notif-item-preview {
  font-size: calc(.8rem * var(--ts, 1));
  color: rgb(var(--muted-fg));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item-meta {
  font-size: calc(.74rem * var(--ts, 1));
  color: rgb(var(--muted-fg));
}

.notif-overlay-preview {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 1.75rem 2rem;
  min-height: 0;
}

.notif-preview-back {
  display: none;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  padding: .3rem 0;
  margin-bottom: 1rem;
  font-size: calc(.85rem * var(--ts, 1));
  font-weight: 600;
  color: rgb(var(--primary));
  cursor: pointer;
  font-family: inherit;
}

.notif-preview-back svg {
  width: calc(16px * var(--ui, 1) * var(--is, 1));
  height: calc(16px * var(--ui, 1) * var(--is, 1));
}

.notif-preview-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--muted-fg));
  font-size: calc(.9rem * var(--ts, 1));
  text-align: center;
}

.notif-preview-icon {
  display: inline-flex;
  width: calc(22px * var(--ui, 1) * var(--is, 1));
  height: calc(22px * var(--ui, 1) * var(--is, 1));
  margin-right: .5rem;
  color: rgb(var(--primary));
  flex-shrink: 0;
}

.notif-preview-icon img {
  width: calc(22px * var(--ui, 1) * var(--is, 1));
  height: calc(22px * var(--ui, 1) * var(--is, 1));
  border-radius: 6px;
  object-fit: cover;
}

.notif-preview-icon svg {
  width: 100%;
  height: 100%;
}

.notif-preview-title,
.notif-preview-desc {
  user-select: text;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notif-preview-title {
  margin: 0 0 .4rem;
  font-size: calc(1.2rem * var(--ts, 1));
  font-weight: 700;
  color: rgb(var(--fg));
  display: flex;
  align-items: center;
}

.notif-preview-date {
  font-size: calc(.8rem * var(--ts, 1));
  color: rgb(var(--muted-fg));
  margin-bottom: 1.1rem;
}

.notif-preview-desc {
  font-size: calc(.92rem * var(--ts, 1));
  line-height: 1.6;
  color: rgb(var(--fg));
  white-space: pre-wrap;
}

.notif-preview-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: calc(.85rem * var(--ts, 1));
  font-weight: 600;
  color: rgb(var(--primary));
  text-decoration: none;
}

.notif-preview-link:hover {
  text-decoration: underline;
}

.notif-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.25rem;
}

.notif-preview-action-btn {
  border: 1px solid rgb(var(--border));
  background: rgb(var(--muted));
  color: rgb(var(--fg));
  font-family: inherit;
  font-size: calc(.85rem * var(--ts, 1));
  font-weight: 600;
  padding: .55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.notif-preview-action-btn:hover {
  background: rgb(var(--border));
}

.notif-preview-action-primary {
  background: rgb(var(--primary));
  border-color: rgb(var(--primary));
  color: rgb(var(--card));
}

.notif-preview-action-primary:hover {
  filter: brightness(1.05);
}

.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: rgb(var(--muted-fg));
  font-size: calc(.875rem * var(--ts, 1));
}

.notif-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: .5rem;
  color: rgb(var(--muted-fg));
  font-size: calc(.85rem * var(--ts, 1));
}

.notif-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgb(var(--border));
  border-top-color: rgb(var(--primary));
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
