/* ===============================================================
   NOTIFICATIONS — the bell icon, its unread badge, and the panel

   Shared by dashboard.html and settings.html, with notifications.js.
   Load after theme.css and projects.css: the panel reuses .client-*
   nothing directly, but sits in the same rail and should feel like
   one design with the site switcher's menu.
   =============================================================== */

.notif-switch { position: relative; }

/* The badge sits on the bell button itself (.rail-btn), not a
   wrapper around it, so it does not shift the button's hit area or
   its position in the rail's flex gap. */
.notif-btn { position: relative; }

.notif-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--notify-badge);
  border: 2px solid var(--rail); box-sizing: content-box;
  color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.notif-badge[hidden] { display: none; }

/* ---- the panel ----
   position: fixed rather than absolute-in-relative, so it never
   depends on measuring the bell's exact position: it always sits
   just outside the rail, at the same offset .canvas uses for its
   own left margin. The mobile override below moves it to a
   full-width sheet under the rail once the rail itself goes
   horizontal (see the 900px breakpoint already in each page). */
.notif-panel {
  position: fixed; left: 108px; bottom: 16px; z-index: 40;
  width: 360px; max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--rule); background: var(--surface);
  /* The panel lives inside .rail, which sets color: var(--rail-ink)
     (white, for its icons) — without overriding it here, the panel's
     own text inherits that white straight through. Invisible on the
     light theme's white --surface; dark mode only looked fine by
     coincidence, since near-black --surface happens to want light
     text anyway. */
  color: var(--ink);
  box-shadow: var(--lift-high);
}
.notif-panel[hidden] { display: none; }

.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--rule-soft);
}
.notif-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; margin-right: auto; }
.notif-clear {
  border: none; background: transparent; padding: 4px 8px; margin-right: 4px;
  border-radius: 8px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.notif-clear:hover { background: var(--rule-soft); color: var(--ink); }
.notif-clear[hidden] { display: none; }

/* Same shape as .pj-close in the "Add site" pop-up (projects.css),
   sized down a touch for this smaller header. */
.notif-close {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border: none; border-radius: 50%; background: transparent;
  color: var(--muted); cursor: pointer;
}
.notif-close:hover { background: var(--rule-soft); color: var(--ink); }
.notif-close svg { width: 14px; height: 14px; }

.notif-list { overflow-y: auto; padding: 6px; }

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; padding: 10px 10px; border-radius: 11px;
}
.notif-item + .notif-item { margin-top: 1px; }

/* An unread item gets a soft wash for the one viewing that made it
   read — the dot beside it is the more permanent signal, this wash
   is just so today's new ones stand out from the list around them. */
.notif-item.is-unread { background: var(--rule-soft); }

.notif-dot {
  flex: none; width: 8px; height: 8px; margin-top: 6px;
  border-radius: 50%; background: var(--purple);
  visibility: hidden;
}
.notif-item.is-unread .notif-dot { visibility: visible; }

.notif-text { min-width: 0; flex: 1; }
.notif-title { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.notif-body { margin: 3px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.notif-time { display: block; margin-top: 5px; font-size: 11.5px; color: var(--faint); }

.notif-remove {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border: none; border-radius: 50%; background: transparent;
  color: var(--faint); cursor: pointer;
}
.notif-remove:hover, .notif-remove:focus-visible { background: var(--rule); color: var(--ink); }
.notif-remove svg { width: 12px; height: 12px; }

.notif-empty {
  padding: 30px 20px; text-align: center;
  color: var(--faint); font-size: 13px;
}

@media (max-width: 900px) {
  .notif-panel {
    left: 14px; right: 14px; bottom: auto; top: 82px;
    width: auto; max-height: calc(100vh - 100px);
  }
}
