/* ─── Notifications: the bell, its dropdown, the list, the settings ─────────── */

.notif { position: relative; display: inline-flex; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: 0.2rem;
  right: 0.15rem;
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 9999px;
  background: var(--danger-fill);
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 0 2px var(--page);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.notif-panel {
  animation: bt-fade-up 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 50;
  width: min(24rem, calc(100vw - 1.5rem));
  max-height: min(32rem, calc(100dvh - 5rem));
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 0.875rem;
  background: var(--surface);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--line);
}
.notif-panel[hidden] { display: none; }
.notif-panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0.625rem 0.75rem 0.625rem 1rem;
}
.notif-panel-title { font-weight: 600; color: var(--ink); }
.notif-panel-actions { display: flex; align-items: center; gap: 0.25rem; }
.notif-panel-foot {
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 0.5rem;
  text-align: center;
}
.notif-panel-empty { padding: 2rem 1.25rem; text-align: center; font-size: 0.9375rem; color: var(--muted); }
.notif-panel .notif-list { border-radius: 0; box-shadow: none; }

@media (max-width: 36rem) {
  /* Phones: the panel spans the width under the header. */
  .notif { position: static; }
  .notif-panel { position: fixed; top: 3.5rem; right: 0.75rem; left: 0.75rem; width: auto; }
}

.notif-list { margin: 0; padding: 0; list-style: none; }
.notif-item + .notif-item { border-top: 1px solid var(--line); }
.notif-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--ink-2);
  text-decoration: none;
}
.notif-link:hover { background: var(--surface-2); }
.notif-item.is-unread .notif-link { color: var(--ink); }
.notif-kind {
  display: inline-flex;
  flex-shrink: 0;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.notif-kind-stats_ready, .notif-kind-stats_watched { background: color-mix(in oklab, var(--link) 14%, var(--surface)); color: var(--link); }
.notif-kind-like { background: color-mix(in oklab, var(--link) 10%, var(--surface)); color: var(--ink-2); }
.notif-kind-decision { background: color-mix(in oklab, var(--danger) 12%, var(--surface)); color: var(--danger); }
.notif-body { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.125rem; }
.notif-text { font-size: 0.9375rem; line-height: 1.4; }
.notif-item.is-unread .notif-text { font-weight: 600; }
.notif-preview {
  overflow: hidden;
  font-size: 0.875rem;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-time { font-size: 0.8125rem; color: var(--muted); }
.notif-dot {
  flex-shrink: 0;
  margin-top: 0.5rem;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: var(--link);
}

.notif-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notif-page-actions { display: flex; align-items: center; gap: 0.25rem; }
.page-narrow > .notif-list { margin-top: 1.25rem; }

/* "Tell me when the split is in" under a locked split. */
.split-watch { margin-top: 0.875rem; }
.split-watch .btn[aria-pressed='true'] { color: var(--link); }
.split-watch-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Settings → Notifications. */
.notif-prefs { width: 100%; border-collapse: collapse; }
.notif-prefs th, .notif-prefs td { border-bottom: 1px solid var(--line); padding: 0.75rem 0.25rem; vertical-align: top; }
.notif-prefs thead th { font-size: 0.8125rem; font-weight: 600; color: var(--muted); text-align: left; }
.notif-prefs thead th + th, .notif-prefs td { width: 5.5rem; text-align: center; }
.notif-prefs tbody th { font-weight: 400; text-align: left; }
.notif-prefs input[type='checkbox'] { height: 1.125rem; width: 1.125rem; margin-top: 0.125rem; accent-color: var(--ink); }
.notif-pref-label { display: block; font-weight: 600; color: var(--ink); }
.notif-pref-desc { display: block; margin-top: 0.125rem; font-size: 0.875rem; color: var(--muted); }
.notif-devices { margin: 0; padding: 0; list-style: none; }
.notif-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.625rem 0;
}
.notif-device-name { display: block; font-weight: 600; color: var(--ink); }
.notif-device-meta { display: block; font-size: 0.8125rem; color: var(--muted); }

/* Who liked a post (its author only). */
.post-likers { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.75rem; font-size: 0.9375rem; }
.post-likers a { display: inline-flex; align-items: center; gap: 0.375rem; }
.post-likers-note { font-size: 0.8125rem; color: var(--muted); }
.likes-post { margin-top: 0.5rem; font-family: var(--font-serif); font-size: 1.0625rem; color: var(--ink-2); }
.likes-sort { margin: 1rem 0 0.75rem; }
.person-meta { margin-left: auto; flex-shrink: 0; font-size: 0.8125rem; color: var(--muted); }

/* "Who to follow" (after sign-up) and its moderators' list. */
.suggest-list { margin-top: 1.25rem; }
.suggest { display: flex; align-items: center; }
.suggest-link { flex: 1; min-width: 0; }
.suggest-note { display: block; margin-top: 0.125rem; font-size: 0.875rem; color: var(--ink-2); }
.suggest-follow { flex-shrink: 0; padding-right: 1rem; }
.suggest-admin { margin: 1rem 0 0; padding: 0; list-style: none; }
.suggest-admin-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--line); padding: 0.875rem 1rem; }
.suggest-admin-row.is-inactive { opacity: 0.6; }
.suggest-admin-who { min-width: 0; flex: 1; }
.suggest-admin-note { display: flex; gap: 0.5rem; margin: 0.5rem 0 0.25rem; }
.suggest-admin-note .control { flex: 1; min-width: 0; }
.suggest-admin-actions { display: flex; gap: 0.25rem; }

/* Settings → Languages you read. */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.25rem 1rem; margin: 0.5rem 0 0; border: 0; padding: 0; }
.lang-option { display: flex; align-items: center; gap: 0.5rem; min-height: 2rem; font-size: 0.9375rem; color: var(--ink); }
.lang-option input { height: 1.0625rem; width: 1.0625rem; accent-color: var(--ink); }
