/* The bell's notifications panel (issue 3502, Figma 50:16291, 288 x 510;
 * notification-bell.ts). The ds/overlays.css popover shell, right edges on
 * the bell's. Tokens only; dark comes from tokens.css (not in Figma).
 *
 * AA deviations, as the design system's: the badge and the active tab's text
 * are --live-text (Figma #059669, 3.6:1), the "// TODAY" labels, times and the
 * read items' text --fg-muted (Figma #9ca3af, 2.5:1): a read item's tile
 * fades to 0.7 and its title turns SemiBold --fg-muted, not paler. Not in Figma (proposed): hover, the
 * gear, the footer, Load more, the empty, loading and error states. */

/* Figma's shadow (Tailwind's shadow-xl); dark keeps it (not in Figma). */
:root { --bell-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }

/* Figma: right edge 14px past the bell's, top 4px above the header's bottom
 * (the popover sits 4px under the 35px bell in the 64px bar). */
.bell-panel {
  width: 288px; max-height: calc(100vh - var(--topbar-height));
  margin: 6.5px 0 0 14px; overflow: hidden;
  border-color: var(--border-strong);
  box-shadow: var(--bell-shadow);
}
@media (max-width: 860px) { .bell-panel { margin: 0; } }

/* The bell's unread dot (50:16288): 6px brand, ringed in the surface. */
.topbar-bell { position: relative; }
.bell-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }
.bell-dot[hidden] { display: none; }

/* Header: padding 12 16, Inter SemiBold 14/20 and the "3 new" badge 4px after. */
.bell-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex: none;
  padding: 12px 16px; border-bottom: 1px solid var(--divider);
}
.bell-heading { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bell-title { margin: 0; font: 600 14px/20px var(--font-sans); letter-spacing: 0.027px; color: var(--fg-strong); }
.bell-heading .badge-type { padding: 1px 7px; border: 1px solid var(--brand); border-radius: var(--radius-pill); line-height: 15px; letter-spacing: 0.25px; }
.bell-head-actions { display: flex; align-items: center; gap: 2px; margin-right: -6px; }

/* Body: 12px sides, a 14px column, 462 tall. Figma draws no scrollbar: a thin thumb on a clear track (#3873),
   --fg-subtle so it reads on the dark surface (--border-strong is ~1.2:1 there). */
.bell-body {
  display: flex; flex-direction: column; gap: 14px;
  height: 462px; box-sizing: border-box; padding: 12px 12px 14px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--fg-subtle) transparent;
}
.bell-feed { display: flex; flex-direction: column; gap: 14px; }

/* Tabs: two 32px chips, gap 8 (Mentions dropped, owner decision). */
.bell-tabs { display: flex; gap: var(--space-2); }
.bell-tab {
  flex: 1 1 0; height: 32px; padding: 0 var(--space-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  font: 700 12px/18px var(--font-sans); color: var(--fg-muted); cursor: pointer;
}
.bell-tab:hover { color: var(--fg); }
.bell-tab[aria-pressed="true"] { border-color: var(--brand); background: var(--select-tint); color: var(--live-text); }
.bell-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.bell-group { margin: 0; font-weight: 700; color: var(--fg-muted); }
.bell-group:not(:first-child) { margin-top: 2px; }
.bell-list { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }

/* Item: 32px tile, text, time and dot; hover tints it (not in Figma). */
.bell-item {
  display: flex; align-items: flex-start; gap: 10px;
  margin: -4px; padding: 4px; border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
a.bell-item:hover { background: var(--surface-sunken); }
a.bell-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.bell-tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  box-sizing: border-box; width: 32px; height: 32px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg-muted);
}
.bell-tile svg { width: 12px; height: 12px; }
.bell-tile-success { border-color: var(--brand); background: var(--select-tint); color: var(--live-text); }
.bell-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.bell-item-title { font: 700 12px/16px var(--font-sans); color: var(--fg); }
.bell-item-body { font: 400 11px/15px var(--font-sans); color: var(--fg-muted); overflow-wrap: anywhere; }
.bell-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.bell-meta time { font: 400 10px/15px var(--font-mono); letter-spacing: 0.2px; color: var(--fg-muted); white-space: nowrap; }
.bell-unread-dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--brand); }
/* Read (Earlier): SemiBold, the tile at 70%. */
.bell-item:not(.is-unread) .bell-item-title { font-weight: 600; color: var(--fg-muted); }
a.bell-item:not(.is-unread) .bell-tile { opacity: 0.7; }
/* New while open: a 160ms fade. */
.bell-item.is-fresh { animation: ui-fade-in 160ms var(--ease-out, ease-out); }
@media (prefers-reduced-motion: reduce) { .bell-item.is-fresh { animation: none; } }

.bell-more { margin: 0; text-align: center; font: var(--type-meta); color: var(--fg-muted); }
.bell-more [aria-disabled="true"] { cursor: progress; }
/* A mark as read that failed (not in Figma): one line above the list. */
/* Above the body, outside the redrawn feed (one announcement per failure). */
.bell-note { flex: none; margin: 12px 12px 0; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger-fg); font: var(--type-meta); }
.bell-note[hidden] { display: none; }
.bell-body .ms-state { padding: var(--space-6) var(--space-2); }

/* Footer (not in Figma): 40px, two links in Inter Bold 12. */
.bell-foot {
  display: flex; align-items: center; justify-content: space-between; flex: none;
  height: 40px; box-sizing: border-box; padding: 0 16px; border-top: 1px solid var(--divider);
}
.bell-link { padding: 0; border: 0; background: none; font: 700 12px/18px var(--font-sans); color: var(--live-text); text-decoration: none; cursor: pointer; }
.bell-link:hover { text-decoration: underline; }
.bell-link:disabled { color: var(--fg-muted); text-decoration: none; cursor: default; }
.bell-loading { margin: 0; padding: var(--space-4); }
