/* Notification centre (0.7.0): the sidebar entry with its badge, the top-bar bell (only when the sidebar is hidden or on a phone), the panel
   next to the sidebar. Built from the existing tokens (surfaces, hairlines, the orange accent, status colours); nothing new in the palette. */

/* ---------- sidebar entry */
.side-notif-wrap { padding: 0.125rem 0.75rem 0.375rem; }
.side-notif { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.5rem 0.625rem; border: 0; border-radius: 0.5rem; background: none; color: var(--fg); font: inherit; font-size: 0.875rem; cursor: pointer; text-align: left; }
.side-notif:hover { background: var(--hover); }
.side-notif[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.side-notif:focus-visible, .notif-top:focus-visible { outline: none; box-shadow: var(--ring); }
.side-notif .sn-label { flex: 1; min-width: 0; }
.notif-badge { min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 999px; background: var(--chip); color: var(--fg); font-size: 0.75rem; font-weight: 600; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.notif-badge.hot { background: var(--accent); color: var(--accent-fg); }
.notif-badge[hidden] { display: none; }

/* ---------- top-bar bell: the sidebar entry is out of sight when the sidebar is hidden, and inside the drawer on a phone */
.notif-top { display: none; position: relative; }
html[data-side="hidden"] .notif-top { display: inline-grid; }
.notif-top .notif-badge { position: absolute; top: -0.25rem; right: -0.375rem; min-width: 1rem; height: 1rem; padding: 0 0.25rem; font-size: 0.625rem; line-height: 1rem; box-shadow: 0 0 0 2px var(--surface); }
@media (max-width: 860px) { .notif-top { display: inline-grid; } }

/* ---------- panel */
.notif-panel { position: fixed; top: 0; bottom: 0; left: var(--side-w); z-index: 60; width: min(27rem, calc(100vw - var(--side-w))); display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.notif-panel[hidden] { display: none; }
html[data-side="hidden"] .notif-panel { left: 0; width: min(27rem, 100vw); }
@media (max-width: 860px) { .notif-panel { left: 0; width: 100vw; z-index: 80; border: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .notif-panel.entering { animation: np-in 0.18s ease-out; }
  @keyframes np-in { from { transform: translateX(-0.75rem); opacity: 0.4; } }
}
.np-head { display: flex; align-items: center; gap: 0.375rem; padding: 0.875rem 0.75rem 0.5rem 1rem; }
.np-head h2 { flex: 1; margin: 0; font-size: 1rem; font-weight: 600; }
.np-filters { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: 0 1rem 0.625rem; border-bottom: 1px solid var(--line-soft); }
.np-filters .chipf { gap: 0.375rem; }
.np-count { min-width: 1.125rem; padding: 0 0.3125rem; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 0.6875rem; font-weight: 600; line-height: 1.125rem; text-align: center; font-variant-numeric: tabular-nums; }
.np-filters .chipf[aria-pressed="true"] .np-count { background: color-mix(in srgb, var(--chip-on-fg) 22%, transparent); color: inherit; }
.np-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 1rem; }
.np-group { position: sticky; top: 0; z-index: 1; padding: 0.75rem 1rem 0.25rem; background: var(--surface); color: var(--muted); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- one notification */
.np-item { position: relative; display: flex; align-items: flex-start; gap: 0.125rem; margin: 0 0.375rem; padding: 0 0.25rem 0 0.625rem; border-radius: 0.5rem; }
.np-item:hover { background: var(--hover); }
.np-item.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.np-item.unread:hover { background: var(--accent-soft); }
.np-item.important.unread::before { content: ""; position: absolute; left: 0; top: 0.5rem; bottom: 0.5rem; width: 3px; border-radius: 3px; background: var(--accent); }
.np-dot { position: absolute; right: 0.625rem; top: 1rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
.np-main { flex: 1; min-width: 0; display: flex; gap: 0.625rem; padding: 0.625rem 0.25rem; border: 0; border-radius: 0.375rem; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.np-main:focus-visible { outline: none; box-shadow: var(--ring); }
.np-ico { flex: none; display: grid; place-items: center; width: 1.875rem; height: 1.875rem; border-radius: 50%; }
.tone-accent { background: var(--accent-soft); color: var(--accent-ink); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-crit { background: var(--crit-soft); color: var(--crit); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-review { background: color-mix(in srgb, var(--st-review) 14%, transparent); color: var(--st-review); }
.tone-muted { background: var(--surface-3); color: var(--muted); }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.np-body { min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; padding-right: 1rem; }
.np-title { font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.np-item.unread .np-title { font-weight: 600; }
.np-subj { display: flex; align-items: center; gap: 0.375rem; min-width: 0; font-size: 0.8125rem; line-height: 1.35; }
.np-subj > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-subj .mono { flex: none; font-size: 0.75rem; font-weight: 600; }
.np-subj.gone > span:last-child { color: var(--faint); text-decoration: line-through; }
.np-detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; color: var(--muted); font-size: 0.8125rem; line-height: 1.35; }
.np-meta { color: var(--faint); font-size: 0.75rem; }
.np-actions { display: flex; gap: 0.125rem; padding-top: 0.5rem; opacity: 0; }
.np-item:hover .np-actions, .np-item:focus-within .np-actions { opacity: 1; }
@media (hover: none) { .np-actions { opacity: 1; } .np-dot { top: auto; bottom: 1rem; } }
.np-item.unread .np-actions { padding-right: 0.875rem; }

/* ---------- states */
.np-empty { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; padding: 3rem 1.75rem; color: var(--muted); text-align: center; }
.np-empty svg { color: var(--faint); margin-bottom: 0.25rem; }
.np-empty p { margin: 0; }
.np-empty-title { color: var(--fg); font-weight: 600; }
.np-more { padding: 0.5rem 1rem; text-align: center; }
.np-skel { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; }
.np-skel .sk-ico { flex: none; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--surface-3); }
.np-skel .sk-lines { flex: 1; display: flex; flex-direction: column; gap: 0.4375rem; padding-top: 0.125rem; }
.np-skel .sk-lines span { height: 0.625rem; border-radius: 0.25rem; background: var(--surface-3); }
.np-skel .sk-lines span:nth-child(1) { width: 55%; } .np-skel .sk-lines span:nth-child(2) { width: 85%; } .np-skel .sk-lines span:nth-child(3) { width: 35%; }
@media (prefers-reduced-motion: no-preference) {
  .np-skel .sk-lines span, .np-skel .sk-ico { animation: np-pulse 1.2s ease-in-out infinite; }
  @keyframes np-pulse { 50% { opacity: 0.55; } }
}
@media (max-width: 480px) { .np-hide-xs { display: none; } }

/* ---------- task panel: the watch toggle and the comment a notification pointed at */
.watch-btn.on { color: var(--accent-ink); }
span.watch-btn { cursor: default; }
.comment.flash { border-radius: 0.5rem; background: var(--accent-soft); transition: background 1.2s ease-out; }
