/* NoRepTV notifications: header bell + popover, /notifications page, unsubscribe page. */

/* Bell button --------------------------------------------------------------- */

.bell { position: relative; }
.bell-btn {
  position: relative; padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
}
.bell-btn[aria-expanded="true"] { background: var(--surface-2); }
.bell-badge {
  position: absolute; top: 2px; right: 0;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font: 700 11px/18px var(--font); text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg); pointer-events: none;
}

/* Popover ------------------------------------------------------------------- */

.bell-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  width: 384px; max-width: calc(100vw - 24px);
  max-height: min(580px, calc(100vh - 90px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden;
  animation: bell-in 0.14s ease-out;
}
@keyframes bell-in { from { opacity: 0; transform: translateY(-4px); } }

.bell-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.bell-head h2 { font-size: 16px; font-weight: 700; }
.bell-markall { font-size: 13px; padding: 4px 0; }
.bell-markall:disabled { color: var(--text-3); cursor: default; text-decoration: none; }

.bell-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.bell-status { display: grid; justify-items: center; gap: 10px; padding: 30px 22px; text-align: center; color: var(--text-2); font-size: 14px; }
.bell-status strong { color: var(--text); font-size: 15px; }

.bell-list { list-style: none; margin: 0; padding: 6px; }
.bell-link {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: start; gap: 12px;
  padding: 10px; border-radius: 10px;
}
.bell-link:hover { background: var(--surface-2); }
.bell-item.is-unread .bell-link { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.bell-item.is-unread .bell-link:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.bell-main { min-width: 0; display: grid; gap: 2px; }
.bell-text { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.bell-text strong { font-weight: 700; }
.bell-snippet {
  font-size: 13px; color: var(--text-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bell-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.bell-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.bell-thumb { width: 72px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.bell-sys {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; background: var(--accent); color: #fff;
}
.notif-ghost { background: var(--hover); color: var(--text-2); }
.bell-all {
  display: block; padding: 12px 16px; border-top: 1px solid var(--line);
  text-align: center; font-size: 14px; font-weight: 600; color: var(--accent-text);
}
.bell-all:hover { background: var(--surface-2); }

/* Phones: the panel spans the screen under the header. .bell becomes static so the
   sticky .topbar is the panel's containing block. */
@media (max-width: 480px) {
  .bell { position: static; }
  .bell-panel {
    left: 8px; right: 8px; top: calc(100% + 6px); width: auto; max-width: none;
    max-height: calc(100vh - 130px);
    max-height: calc(100dvh - 130px);
  }
  .bell-thumb { width: 60px; }
}

/* /notifications page ------------------------------------------------------- */

.notif-page { max-width: 760px; margin: 0 auto; }
.notif-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 16px;
  margin-bottom: 10px;
}
.notif-head .page-title { margin-bottom: 8px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item + .notif-item { border-top: 1px solid var(--line); }
.notif-link {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: start; gap: 14px;
  padding: 14px 12px; border-radius: 12px;
}
.notif-link:hover { background: var(--surface); }
.notif-item.is-unread .notif-link { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif-item.is-unread .notif-link:hover { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
.notif-sys { width: 40px; height: 40px; }
.notif-main { min-width: 0; display: grid; gap: 3px; }
.notif-text { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.notif-text strong { font-weight: 700; }
.notif-snippet {
  font-size: 14px; color: var(--text-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.notif-new { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 700; }
.notif-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--surface-2); }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  .notif-link { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 8px; }
  .notif-link .avatar { --size: 36px !important; }
  .notif-sys { width: 36px; height: 36px; }
  .notif-thumb { grid-column: 2; width: 128px; }
  .pager .btn { padding: 0 12px; }
}

/* Unsubscribe page ---------------------------------------------------------- */

.unsub-icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 16px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.unsub-card .page-title { margin-bottom: 10px; }
.unsub-card > p.muted { margin-bottom: 10px; }
.unsub-card .form-ok { margin-bottom: 14px; }
.unsub-email { color: var(--text); overflow-wrap: anywhere; }
.unsub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.unsub-actions .btn {
  height: auto; min-height: 38px; padding-top: 9px; padding-bottom: 9px;
  white-space: normal; text-align: center; line-height: 1.3;
}
.unsub-more { margin-top: 18px; }

@media (max-width: 480px) {
  .unsub-actions .btn { width: 100%; }
}
