{
  "id": 149,
  "slug": "priority-notification-snooze",
  "name": "Grouped Priority Notification Center",
  "kind": "ui",
  "family": "Communication & Triage",
  "sourceSite": {
    "name": "Knock",
    "url": "https://knock.app/",
    "verifiedStatus": 200
  },
  "tagline": "Priority-grouped notification inbox (Urgent / Today / Earlier) with All/Unread/Snoozed filters, per-item Snooze menus, and Undo.",
  "whyUnique": "Prevents alert fatigue by separating Urgent incidents from Today and Earlier updates, offering one-tap Snooze presets (1h, Tomorrow 9am, Next week) and reversible archive/read actions.",
  "theme": "light",
  "mobileStrength": "native-first",
  "tags": [
    "notifications",
    "snooze",
    "priority-inbox",
    "alert-center",
    "undo-toast",
    "triage"
  ],
  "bestFor": [
    "SaaS in-app notification feeds and activity centers",
    "On-call incident and CI/CD alert triage",
    "Approval workflows and review reminders",
    "Multi-channel collaboration platforms"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#F5F5FA",
      "name": "Serene Mist"
    },
    {
      "role": "surface",
      "hex": "#FFFFFF",
      "name": "Inbox White"
    },
    {
      "role": "ink",
      "hex": "#181826",
      "name": "Obsidian Slate"
    },
    {
      "role": "accent",
      "hex": "#6D28D9",
      "name": "Knock Violet"
    },
    {
      "role": "muted",
      "hex": "#6B6B82",
      "name": "Quiet Lavender"
    }
  ],
  "typography": {
    "display": "Inter",
    "body": "Inter",
    "mono": "JetBrains Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&family=JetBrains+Mono:wght@500;600&display=swap",
    "scaleNotes": "18px header title, 11px uppercase priority group headers, 14px notification titles, 12px relative timestamps."
  },
  "layoutNotes": "Centered 760px feed container with sticky filter tabs (All / Unread / Snoozed), bulk Mark All Read button, and priority-grouped cards with inline action pills.",
  "interactionNotes": "Click Snooze on any item to pick 1 hour, Tomorrow 9am, or Next week; toggle Read/Unread or Archive with a floating Undo toast; filter tabs update live counts.",
  "mobileNotes": "Maintains >=44px touch targets across filter tabs, snooze presets, and per-item actions with zero horizontal overflow at 390px.",
  "agentGuardrails": {
    "do": [
      "Group notifications by urgency/recency (Urgent, Today, Earlier) rather than a flat wall of alerts.",
      "Always pair Archive and Snooze actions with an immediate Undo toast.",
      "Provide a one-click 'Mark all read' action when unread items exist."
    ],
    "dont": [
      "Never hide Snooze or Mark Read strictly behind desktop hover states.",
      "Avoid red badge overload—reserve high-urgency crimson strictly for Urgent-tier items."
    ]
  },
  "demoFile": "demos/priority-notification-snooze.html",
  "thumbDesktop": "thumbs/priority-notification-snooze-desktop.webp",
  "thumbMobile": "thumbs/priority-notification-snooze-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/priority-notification-snooze",
    "markdown": "https://templates.michaelpitts.net/t/priority-notification-snooze.md",
    "api": "https://templates.michaelpitts.net/api/templates/priority-notification-snooze",
    "demo": "https://templates.michaelpitts.net/demos/priority-notification-snooze.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/priority-notification-snooze-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/priority-notification-snooze-mobile.webp"
  },
  "agentPrompt": "Design & build using template #149 \"Grouped Priority Notification Center\" (ui / Communication & Triage, light theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/priority-notification-snooze.md\nLive demo: https://templates.michaelpitts.net/demos/priority-notification-snooze.html\nReal-world inspiration: Knock (https://knock.app/)\n\nCore aesthetic: Prevents alert fatigue by separating Urgent incidents from Today and Earlier updates, offering one-tap Snooze presets (1h, Tomorrow 9am, Next week) and reversible archive/read actions.\nPalette: canvas: #F5F5FA (Serene Mist), surface: #FFFFFF (Inbox White), ink: #181826 (Obsidian Slate), accent: #6D28D9 (Knock Violet), muted: #6B6B82 (Quiet Lavender)\nTypography: Display=\"Inter\", Body=\"Inter\", Mono=\"JetBrains Mono\"\nLayout: Centered 760px feed container with sticky filter tabs (All / Unread / Snoozed), bulk Mark All Read button, and priority-grouped cards with inline action pills.\nInteractions: Click Snooze on any item to pick 1 hour, Tomorrow 9am, or Next week; toggle Read/Unread or Archive with a floating Undo toast; filter tabs update live counts.\nMobile: Maintains >=44px touch targets across filter tabs, snooze presets, and per-item actions with zero horizontal overflow at 390px.\n\nGuardrails:\n- DO: Group notifications by urgency/recency (Urgent, Today, Earlier) rather than a flat wall of alerts.\n- DO: Always pair Archive and Snooze actions with an immediate Undo toast.\n- DO: Provide a one-click 'Mark all read' action when unread items exist.\n- DON'T: Never hide Snooze or Mark Read strictly behind desktop hover states.\n- DON'T: Avoid red badge overload—reserve high-urgency crimson strictly for Urgent-tier items.",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Relay Inbox — Grouped Priority Notifications &amp; Snooze</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap\" rel=\"stylesheet\">\n<style>\n  :root {\n    --bg: #F4F5FA;\n    --surface: #FFFFFF;\n    --mist: #ECEEF7;\n    --violet: #6D28D9;\n    --violet-soft: #EDE9FE;\n    --violet-mid: #7C3AED;\n    --urgent: #DC2626;\n    --urgent-soft: #FEE2E2;\n    --amber: #B45309;\n    --amber-soft: #FEF3C7;\n    --ink: #181825;\n    --muted: #64667B;\n    --border: rgba(24, 24, 37, 0.09);\n    --radius: 14px;\n    --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;\n  }\n\n  * { box-sizing: border-box; margin: 0; padding: 0; }\n\n  html, body {\n    background: var(--bg);\n    color: var(--ink);\n    font-family: var(--sans);\n    -webkit-font-smoothing: antialiased;\n    overflow-x: hidden;\n    min-height: 100vh;\n  }\n\n  .page {\n    max-width: 820px;\n    margin: 0 auto;\n    padding: 28px 18px 96px;\n  }\n\n  .inbox-card {\n    background: var(--surface);\n    border: 1px solid var(--border);\n    border-radius: 18px;\n    box-shadow: 0 12px 36px rgba(34, 24, 72, 0.06);\n    overflow: visible;\n  }\n\n  .inbox-head {\n    padding: 20px 22px 14px;\n    border-bottom: 1px solid var(--border);\n    display: flex;\n    flex-direction: column;\n    gap: 14px;\n  }\n\n  .head-top {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    flex-wrap: wrap;\n  }\n\n  .title-wrap {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .bell-badge {\n    width: 38px;\n    height: 38px;\n    border-radius: 11px;\n    background: linear-gradient(135deg, #6D28D9, #8B5CF6);\n    color: #fff;\n    display: grid;\n    place-items: center;\n  }\n\n  .title-wrap h1 {\n    font-size: 1.2rem;\n    font-weight: 700;\n    letter-spacing: -0.02em;\n  }\n\n  .title-wrap p {\n    font-size: 0.78rem;\n    color: var(--muted);\n  }\n\n  .mark-all-btn {\n    min-height: 44px;\n    padding: 0 14px;\n    border-radius: 10px;\n    border: 1px solid var(--border);\n    background: var(--surface);\n    color: var(--violet);\n    font-family: inherit;\n    font-size: 0.82rem;\n    font-weight: 600;\n    cursor: pointer;\n    transition: background 0.15s ease;\n  }\n\n  .mark-all-btn:hover { background: var(--violet-soft); }\n\n  .tabs {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    overflow-x: auto;\n    scrollbar-width: none;\n  }\n  .tabs::-webkit-scrollbar { display: none; }\n\n  .tab {\n    min-height: 44px;\n    padding: 0 16px;\n    border-radius: 999px;\n    border: 1px solid var(--border);\n    background: var(--bg);\n    color: var(--muted);\n    font-family: inherit;\n    font-size: 0.84rem;\n    font-weight: 600;\n    display: inline-flex;\n    align-items: center;\n    gap: 7px;\n    cursor: pointer;\n    white-space: nowrap;\n    transition: all 0.15s ease;\n  }\n\n  .tab.active {\n    background: var(--violet);\n    color: #fff;\n    border-color: var(--violet);\n  }\n\n  .tab-count {\n    padding: 1px 7px;\n    border-radius: 999px;\n    font-size: 0.72rem;\n    background: rgba(24, 24, 37, 0.08);\n  }\n\n  .tab.active .tab-count {\n    background: rgba(255, 255, 255, 0.22);\n  }\n\n  /* Groups */\n  .groups {\n    padding: 8px 0 12px;\n  }\n\n  .group-label {\n    padding: 12px 22px 8px;\n    font-size: 0.72rem;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.09em;\n    color: var(--muted);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .group-label.urgent { color: var(--urgent); }\n\n  .group-dot {\n    width: 7px;\n    height: 7px;\n    border-radius: 50%;\n    background: currentColor;\n  }\n\n  .notif {\n    position: relative;\n    padding: 14px 22px;\n    border-top: 1px solid rgba(24, 24, 37, 0.06);\n    display: grid;\n    grid-template-columns: 40px 1fr auto;\n    gap: 13px;\n    align-items: start;\n    transition: background 0.14s ease;\n  }\n\n  .notif:hover { background: #FAF9FE; }\n  .notif.unread { background: #F7F5FF; }\n  .notif.unread:hover { background: #F1EDFF; }\n\n  .notif-icon {\n    width: 40px;\n    height: 40px;\n    border-radius: 11px;\n    display: grid;\n    place-items: center;\n    font-size: 0.82rem;\n    font-weight: 700;\n    position: relative;\n  }\n\n  .notif.unread .notif-icon::after {\n    content: '';\n    position: absolute;\n    top: -3px;\n    right: -3px;\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n    background: var(--violet);\n    border: 2px solid #fff;\n  }\n\n  .notif-content { min-width: 0; }\n\n  .notif-title {\n    font-size: 0.9rem;\n    font-weight: 600;\n    line-height: 1.35;\n    margin-bottom: 3px;\n  }\n\n  .notif-desc {\n    font-size: 0.82rem;\n    color: var(--muted);\n    line-height: 1.48;\n    margin-bottom: 6px;\n  }\n\n  .notif-meta {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    flex-wrap: wrap;\n    font-size: 0.74rem;\n    color: var(--muted);\n  }\n\n  .pill-tag {\n    padding: 2px 8px;\n    border-radius: 6px;\n    font-size: 0.7rem;\n    font-weight: 600;\n    background: var(--mist);\n    color: var(--ink);\n  }\n\n  .pill-urgent { background: var(--urgent-soft); color: var(--urgent); }\n  .pill-snooze { background: var(--amber-soft); color: var(--amber); }\n\n  .notif-actions {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    position: relative;\n  }\n\n  .icon-btn {\n    width: 44px;\n    height: 44px;\n    border-radius: 10px;\n    border: 1px solid transparent;\n    background: transparent;\n    color: var(--muted);\n    display: grid;\n    place-items: center;\n    cursor: pointer;\n    transition: all 0.14s ease;\n  }\n\n  .icon-btn:hover {\n    background: var(--mist);\n    color: var(--ink);\n    border-color: var(--border);\n  }\n\n  .icon-btn.active {\n    background: var(--violet-soft);\n    color: var(--violet);\n    border-color: rgba(109, 40, 217, 0.25);\n  }\n\n  /* Snooze Popover */\n  .snooze-menu {\n    position: absolute;\n    top: 48px;\n    right: 0;\n    width: 196px;\n    background: var(--surface);\n    border: 1px solid var(--border);\n    border-radius: 12px;\n    box-shadow: 0 14px 34px rgba(24, 24, 37, 0.16);\n    padding: 6px;\n    z-index: 40;\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n  }\n\n  .snooze-opt {\n    min-height: 44px;\n    padding: 0 12px;\n    border: none;\n    border-radius: 8px;\n    background: transparent;\n    color: var(--ink);\n    font-family: inherit;\n    font-size: 0.82rem;\n    font-weight: 500;\n    text-align: left;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    cursor: pointer;\n  }\n\n  .snooze-opt:hover { background: var(--violet-soft); color: var(--violet); }\n  .snooze-opt small { color: var(--muted); font-size: 0.72rem; }\n\n  .empty {\n    padding: 56px 24px;\n    text-align: center;\n    color: var(--muted);\n  }\n\n  .empty h2 {\n    font-size: 1.05rem;\n    color: var(--ink);\n    margin-bottom: 6px;\n  }\n\n  /* Undo Toast */\n  .toast {\n    position: fixed;\n    left: 50%;\n    bottom: 22px;\n    transform: translateX(-50%) translateY(90px);\n    background: #1C192E;\n    color: #F4F5FA;\n    padding: 8px 10px 8px 16px;\n    border-radius: 12px;\n    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    font-size: 0.84rem;\n    z-index: 60;\n    opacity: 0;\n    pointer-events: none;\n    transition: transform 0.22s ease, opacity 0.22s ease;\n    max-width: calc(100vw - 24px);\n  }\n\n  .toast.show {\n    transform: translateX(-50%) translateY(0);\n    opacity: 1;\n    pointer-events: auto;\n  }\n\n  .undo-btn {\n    min-height: 44px;\n    padding: 0 14px;\n    border-radius: 8px;\n    border: none;\n    background: #8B5CF6;\n    color: #fff;\n    font-family: inherit;\n    font-size: 0.82rem;\n    font-weight: 700;\n    cursor: pointer;\n  }\n\n  @media (max-width: 600px) {\n    .page { padding: 12px 10px 88px; }\n    .inbox-head { padding: 14px 14px 12px; }\n    .group-label { padding: 10px 14px 6px; }\n    .notif {\n      padding: 12px 14px;\n      grid-template-columns: 36px 1fr;\n      gap: 10px;\n    }\n    .notif-icon { width: 36px; height: 36px; }\n    .notif-actions {\n      grid-column: 1 / -1;\n      justify-content: flex-end;\n      border-top: 1px dashed rgba(24, 24, 37, 0.08);\n      padding-top: 6px;\n      margin-top: 2px;\n    }\n  }\n</style>\n</head>\n<body>\n\n<div class=\"page\">\n  <section class=\"inbox-card\" aria-label=\"Notification center\">\n    <header class=\"inbox-head\">\n      <div class=\"head-top\">\n        <div class=\"title-wrap\">\n          <div class=\"bell-badge\" aria-hidden=\"true\">\n            <svg width=\"19\" height=\"19\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9\"/><path d=\"M13.73 21a2 2 0 0 1-3.46 0\"/></svg>\n          </div>\n          <div>\n            <h1>Relay Inbox</h1>\n            <p id=\"inboxSubtitle\">Priority notifications &middot; Smart snooze</p>\n          </div>\n        </div>\n        <button class=\"mark-all-btn\" id=\"markAllBtn\" type=\"button\">Mark all read</button>\n      </div>\n\n      <div class=\"tabs\" role=\"tablist\" id=\"filterTabs\"></div>\n    </header>\n\n    <div class=\"groups\" id=\"groupsContainer\" aria-live=\"polite\"></div>\n  </section>\n</div>\n\n<div class=\"toast\" id=\"toast\" role=\"status\" aria-live=\"polite\">\n  <span id=\"toastText\">Notification archived</span>\n  <button class=\"undo-btn\" id=\"undoBtn\" type=\"button\">Undo</button>\n</div>\n\n<script>\nlet notifications = [\n  {\n    id: 'n1', group: 'Urgent', unread: true, snoozedUntil: null, archived: false,\n    badge: 'PD', bg: '#FEE2E2', fg: '#B91C1C', source: 'PagerDuty', time: '4m ago',\n    title: 'Checkout API p99 latency exceeded 1,200ms in us-east-1',\n    desc: 'Auto-scaling added 4 pods, but Redis connection pool saturation remains at 94%. Assigned to @oncall-payments.'\n  },\n  {\n    id: 'n2', group: 'Urgent', unread: true, snoozedUntil: null, archived: false,\n    badge: 'SEC', bg: '#FEF3C7', fg: '#B45309', source: 'Security', time: '19m ago',\n    title: 'Production webhook signing secret expires in 18 hours',\n    desc: 'Rotate key `whsec_live_9f2a` in Stripe Dashboard and sync to Vault before 04:00 UTC.'\n  },\n  {\n    id: 'n3', group: 'Today', unread: true, snoozedUntil: null, archived: false,\n    badge: 'GH', bg: '#EDE9FE', fg: '#5B21B6', source: 'GitHub', time: '1h ago',\n    title: 'Maya requested your review on PR #842: Retry idempotency keys',\n    desc: '+214 / -38 across 6 files. All 142 unit and contract tests passing.'\n  },\n  {\n    id: 'n4', group: 'Today', unread: false, snoozedUntil: null, archived: false,\n    badge: 'FG', bg: '#E0F2FE', fg: '#0369A1', source: 'Figma', time: '3h ago',\n    title: 'Sora mentioned you in \"Billing Upgrade Drawer v3\"',\n    desc: '\"Can we confirm whether the annual toggle persists when switching currency?\"'\n  },\n  {\n    id: 'n5', group: 'Today', unread: true, snoozedUntil: 'Tomorrow 9:00 AM', archived: false,\n    badge: 'LN', bg: '#DCFCE7', fg: '#15803D', source: 'Linear', time: '4h ago',\n    title: 'ENG-419 moved to Ready for QA: Export CSV with UTF-8 BOM',\n    desc: 'Snoozed until morning QA sweep.'\n  },\n  {\n    id: 'n6', group: 'Earlier', unread: false, snoozedUntil: null, archived: false,\n    badge: 'ST', bg: '#F3E8FF', fg: '#7E22CE', source: 'Stripe', time: 'Yesterday',\n    title: 'Enterprise invoice #INV-2094 ($18,400) paid by Northwind Labs',\n    desc: 'Funds scheduled for automatic payout on Friday.'\n  },\n  {\n    id: 'n7', group: 'Earlier', unread: false, snoozedUntil: null, archived: false,\n    badge: 'VR', bg: '#E2E8F0', fg: '#334155', source: 'Vercel', time: '2d ago',\n    title: 'Production deployment ready: marketing-site@4f92c1',\n    desc: 'Lighthouse performance score: 99 desktop / 96 mobile.'\n  }\n];\n\nlet activeTab = 'all';\nlet openSnoozeId = null;\nlet lastAction = null;\nlet toastTimer = null;\n\nconst filterTabs = document.getElementById('filterTabs');\nconst groupsContainer = document.getElementById('groupsContainer');\nconst toast = document.getElementById('toast');\nconst toastText = document.getElementById('toastText');\n\nfunction showToast(msg, undoFn) {\n  lastAction = undoFn;\n  toastText.textContent = msg;\n  toast.classList.add('show');\n  clearTimeout(toastTimer);\n  toastTimer = setTimeout(() => {\n    toast.classList.remove('show');\n    lastAction = null;\n  }, 4500);\n}\n\ndocument.getElementById('undoBtn').addEventListener('click', () => {\n  if (lastAction) {\n    lastAction();\n    lastAction = null;\n    toast.classList.remove('show');\n    render();\n  }\n});\n\nfunction getFiltered() {\n  const active = notifications.filter(n => !n.archived);\n  if (activeTab === 'unread') return active.filter(n => n.unread && !n.snoozedUntil);\n  if (activeTab === 'snoozed') return active.filter(n => Boolean(n.snoozedUntil));\n  return active.filter(n => !n.snoozedUntil);\n}\n\nfunction renderTabs() {\n  const active = notifications.filter(n => !n.archived);\n  const counts = {\n    all: active.filter(n => !n.snoozedUntil).length,\n    unread: active.filter(n => n.unread && !n.snoozedUntil).length,\n    snoozed: active.filter(n => Boolean(n.snoozedUntil)).length\n  };\n\n  document.getElementById('inboxSubtitle').textContent =\n    `${counts.unread} unread · ${counts.snoozed} snoozed`;\n\n  const defs = [\n    { key: 'all', label: 'All' },\n    { key: 'unread', label: 'Unread' },\n    { key: 'snoozed', label: 'Snoozed' }\n  ];\n\n  filterTabs.innerHTML = '';\n  defs.forEach(d => {\n    const b = document.createElement('button');\n    b.type = 'button';\n    b.className = 'tab' + (activeTab === d.key ? ' active' : '');\n    b.innerHTML = `<span>${d.label}</span><span class=\"tab-count\">${counts[d.key]}</span>`;\n    b.addEventListener('click', () => {\n      activeTab = d.key;\n      openSnoozeId = null;\n      render();\n    });\n    filterTabs.appendChild(b);\n  });\n}\n\nfunction renderGroups() {\n  const list = getFiltered();\n  groupsContainer.innerHTML = '';\n\n  if (list.length === 0) {\n    groupsContainer.innerHTML = `\n      <div class=\"empty\">\n        <h2>All caught up</h2>\n        <p>${activeTab === 'snoozed' ? 'No snoozed notifications right now.' : 'Nothing waiting in this view.'}</p>\n      </div>`;\n    return;\n  }\n\n  const order = activeTab === 'snoozed' ? ['Snoozed'] : ['Urgent', 'Today', 'Earlier'];\n  order.forEach(groupName => {\n    const items = activeTab === 'snoozed'\n      ? list\n      : list.filter(n => n.group === groupName);\n    if (items.length === 0) return;\n\n    const head = document.createElement('div');\n    head.className = 'group-label' + (groupName === 'Urgent' ? ' urgent' : '');\n    head.innerHTML = `<span class=\"group-dot\"></span><span>${groupName} (${items.length})</span>`;\n    groupsContainer.appendChild(head);\n\n    items.forEach(n => {\n      const row = document.createElement('article');\n      row.className = 'notif' + (n.unread ? ' unread' : '');\n      row.innerHTML = `\n        <div class=\"notif-icon\" style=\"background:${n.bg};color:${n.fg}\">${n.badge}</div>\n        <div class=\"notif-content\">\n          <div class=\"notif-title\">${n.title}</div>\n          <div class=\"notif-desc\">${n.desc}</div>\n          <div class=\"notif-meta\">\n            <span class=\"pill-tag ${n.group === 'Urgent' ? 'pill-urgent' : ''}\">${n.source}</span>\n            ${n.snoozedUntil ? `<span class=\"pill-tag pill-snooze\">Snoozed · ${n.snoozedUntil}</span>` : ''}\n            <span>${n.time}</span>\n          </div>\n        </div>\n        <div class=\"notif-actions\">\n          <button class=\"icon-btn ${openSnoozeId === n.id ? 'active' : ''}\" data-act=\"snooze\" type=\"button\" title=\"${n.snoozedUntil ? 'Unsnooze' : 'Snooze'}\" aria-label=\"${n.snoozedUntil ? 'Unsnooze notification' : 'Snooze notification'}\">\n            <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7v5l3 2\"/></svg>\n          </button>\n          <button class=\"icon-btn\" data-act=\"read\" type=\"button\" title=\"${n.unread ? 'Mark read' : 'Mark unread'}\" aria-label=\"${n.unread ? 'Mark read' : 'Mark unread'}\">\n            <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M20 6L9 17l-5-5\"/></svg>\n          </button>\n          <button class=\"icon-btn\" data-act=\"archive\" type=\"button\" title=\"Archive\" aria-label=\"Archive notification\">\n            <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"4\" rx=\"1\"/><path d=\"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8\"/><path d=\"M10 12h4\"/></svg>\n          </button>\n        </div>\n      `;\n\n      const actionsEl = row.querySelector('.notif-actions');\n\n      if (openSnoozeId === n.id) {\n        const menu = document.createElement('div');\n        menu.className = 'snooze-menu';\n        const opts = [\n          { label: 'In 1 hour', sub: '+60m', val: 'In 1 hour' },\n          { label: 'Tomorrow', sub: '9:00 AM', val: 'Tomorrow 9:00 AM' },\n          { label: 'Next week', sub: 'Mon 9:00 AM', val: 'Next Mon 9:00 AM' }\n        ];\n        opts.forEach(o => {\n          const ob = document.createElement('button');\n          ob.type = 'button';\n          ob.className = 'snooze-opt';\n          ob.innerHTML = `<span>${o.label}</span><small>${o.sub}</small>`;\n          ob.addEventListener('click', (e) => {\n            e.stopPropagation();\n            const prev = n.snoozedUntil;\n            n.snoozedUntil = o.val;\n            openSnoozeId = null;\n            showToast(`Snoozed until ${o.val}`, () => { n.snoozedUntil = prev; });\n            render();\n          });\n          menu.appendChild(ob);\n        });\n        actionsEl.appendChild(menu);\n      }\n\n      row.querySelector('[data-act=\"snooze\"]').addEventListener('click', (e) => {\n        e.stopPropagation();\n        if (n.snoozedUntil) {\n          const prev = n.snoozedUntil;\n          n.snoozedUntil = null;\n          showToast('Returned to inbox', () => { n.snoozedUntil = prev; });\n          render();\n        } else {\n          openSnoozeId = openSnoozeId === n.id ? null : n.id;\n          render();\n        }\n      });\n\n      row.querySelector('[data-act=\"read\"]').addEventListener('click', (e) => {\n        e.stopPropagation();\n        const prev = n.unread;\n        n.unread = !n.unread;\n        showToast(n.unread ? 'Marked as unread' : 'Marked as read', () => { n.unread = prev; });\n        render();\n      });\n\n      row.querySelector('[data-act=\"archive\"]').addEventListener('click', (e) => {\n        e.stopPropagation();\n        n.archived = true;\n        openSnoozeId = null;\n        showToast('Notification archived', () => { n.archived = false; });\n        render();\n      });\n\n      groupsContainer.appendChild(row);\n    });\n  });\n}\n\ndocument.getElementById('markAllBtn').addEventListener('click', () => {\n  const changed = notifications.filter(n => !n.archived && !n.snoozedUntil && n.unread);\n  if (changed.length === 0) return;\n  changed.forEach(n => { n.unread = false; });\n  showToast(`Marked ${changed.length} as read`, () => {\n    changed.forEach(n => { n.unread = true; });\n  });\n  render();\n});\n\ndocument.addEventListener('click', () => {\n  if (openSnoozeId !== null) {\n    openSnoozeId = null;\n    render();\n  }\n});\n\nfunction render() {\n  renderTabs();\n  renderGroups();\n}\n\nrender();\n</script>\n</body>\n</html>\n"
}
