/* ═══ batch3-notifs — Notification settings, Bells, row menu (the app's screens) ═══
   Panels carry their own theme colours (never the header's ink): dark by default,
   body.light for the light theme. */
.nb3-settings { --nb3-card: var(--bg3); --nb3-line: rgba(255,255,255,.08); --nb3-soft: rgba(var(--accent-rgb),.16); --nb3-ink: var(--accent-light); color: var(--text); }
body.light .nb3-settings, body.light .nb3-popup, body.light .nb3-bells-page { --nb3-card: #ffffff; --nb3-line: rgba(15,23,42,.09); --nb3-soft: rgba(var(--accent-rgb),.12); --nb3-ink: var(--accent-strong); }
.nb3-popup, .nb3-bells-page { --nb3-card: var(--bg3); --nb3-line: rgba(255,255,255,.08); --nb3-soft: rgba(var(--accent-rgb),.16); --nb3-ink: var(--accent-light); }
body.light .nb3-settings.notif-settings-dialog { background: var(--bg); }

.nb3-settings .notif-settings-intro { text-align: center; margin: 6px 0 4px; }
.nb3-section { border: 0 !important; margin: 18px 0 0 !important; padding: 0 !important; }
.nb3-section-title { margin: 0 4px 8px !important; font-size: 12px !important; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text2); }
.nb3-card { background: var(--nb3-card); border: 1px solid var(--nb3-line); border-radius: 16px; overflow: hidden; }
.nb3-card-single { margin-top: 14px; }
.nb3-card > * + *, .nb3-card > .nb3-row-wrap + .nb3-row-wrap, .nb3-card > label + label { border-top: 1px solid var(--nb3-line); }
.nb3-row-wrap { display: flex; align-items: center; }
.nb3-row-wrap > .nb3-row { flex: 1; min-width: 0; }
.nb3-settings button.nb3-row, .nb3-row { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; min-height: 60px; padding: 12px 14px; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.nb3-settings button.nb3-row:hover, label.nb3-row:hover { background: rgba(var(--accent-rgb),.06); }
.nb3-settings button.nb3-row:focus-visible, .nb3-row:focus-within { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.nb3-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--nb3-soft); color: var(--nb3-ink); }
.nb3-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb3-row-title { font-size: 15px; font-weight: 600; color: var(--text); }
.nb3-row-detail { font-size: 12.5px; line-height: 1.35; color: var(--text2); overflow-wrap: anywhere; }
.nb3-chevron { flex: 0 0 auto; font-size: 22px; line-height: 1; color: var(--text2); }
.nb3-settings .nb3-row-action { flex: 0 0 auto; margin-right: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--nb3-line); background: transparent; color: var(--nb3-ink); font-size: 12px; font-weight: 700; }
.nb3-retry .nb3-row-detail strong { color: var(--nb3-ink); }

/* The app's drawn toggle */
.nb3-switch { -webkit-appearance: none; appearance: none; flex: 0 0 auto; position: relative; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: rgba(148,163,184,.45); cursor: pointer; transition: background .15s; }
.nb3-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.nb3-switch:checked { background: var(--accent-primary); }
.nb3-switch:checked::after { transform: translateX(18px); }
.nb3-switch:disabled { opacity: .55; cursor: wait; }
.nb3-switch:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .nb3-switch, .nb3-switch::after { transition: none; } }
.nb3-note, .nb3-footer { margin: 8px 4px 0 !important; font-size: 12px !important; color: var(--text2); }
.nb3-footer { margin-top: 16px !important; }

/* ── Centred pop-ups (never bottom sheets) ── */
.nb3-popup { width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-sizing: border-box; margin: auto; padding: 18px 14px 10px; border: 1px solid rgba(var(--accent-rgb),.3); border-radius: 20px; background: var(--bg2); color: var(--text); overflow: auto; font: inherit; }
body.light .nb3-popup { background: #ffffff; }
.nb3-popup::backdrop { background: rgba(0,0,0,.45); }
.nb3-popup-title { margin: 0 6px 4px; font-size: 17px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.nb3-popup-subtitle { margin: 0 6px 12px; font-size: 13px; line-height: 1.45; color: var(--text2); }
.nb3-popup-feedback { margin: 6px; font-size: 13px; color: var(--text2); min-height: 0; }
.nb3-popup-feedback:empty { display: none; }
.nb3-popup-feedback.is-error { color: var(--danger, #ef4444); }
.nb3-popup-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 4px 4px; }
.nb3-btn { min-height: 40px; padding: 8px 18px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.nb3-btn-primary { background: var(--accent-primary); color: var(--accent-contrast, #fff); }
.nb3-btn-ghost { background: transparent; color: var(--text2); border-color: var(--nb3-line); }
.nb3-btn-danger { background: transparent; color: #ef4444; border-color: rgba(239,68,68,.45); }
.nb3-btn:disabled { opacity: .5; cursor: default; }
.nb3-btn:focus-visible, .nb3-option:focus-visible, .nb3-menu-item:focus-visible, .nb3-person:focus-visible, .nb3-chip:focus-visible, .nb3-step:focus-visible, .nb3-bell-row:focus-visible, .nb3-back:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.nb3-options { display: flex; flex-direction: column; gap: 8px; }
.nb3-option { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1.5px solid var(--nb3-line); border-radius: 14px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.nb3-option.is-selected { border-color: var(--accent-primary); background: var(--nb3-soft); }
.nb3-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb3-option-label { font-size: 15px; font-weight: 600; color: var(--text); }
.nb3-option-detail { font-size: 12.5px; color: var(--text2); overflow-wrap: anywhere; }
.nb3-option-danger { justify-content: center; border-color: transparent; color: #ef4444; font-weight: 700; margin-top: 4px; }
.nb3-option-danger:hover { background: rgba(239,68,68,.08); }
.nb3-radio { flex: 0 0 20px; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--text2); }
.nb3-option.is-selected .nb3-radio { border-color: var(--accent-primary); background: radial-gradient(circle, var(--accent-primary) 0 4.5px, transparent 5px); }
.nb3-steppers { padding: 2px 6px 4px; }
.nb3-stepper { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.nb3-stepper-label { flex: 1; font-size: 14.5px; color: var(--text2); }
.nb3-step { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--nb3-soft); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.nb3-stepper-value { min-width: 64px; text-align: center; font-size: 16px; font-weight: 700; color: var(--text); }
.nb3-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nb3-chip { padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--nb3-line); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.nb3-chip.is-on { border-color: var(--accent-primary); background: var(--nb3-soft); color: var(--nb3-ink); }
.nb3-menu { display: flex; flex-direction: column; }
.nb3-menu-item { min-height: 48px; padding: 0 12px; border: 0; border-top: 1px solid var(--nb3-line); background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; border-radius: 0; }
.nb3-menu-item:first-child { border-top: 0; }
.nb3-menu-item:hover { background: rgba(var(--accent-rgb),.06); }
.nb3-menu-item.is-danger { color: #ef4444; }
.nb3-people { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.nb3-person { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 4px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.nb3-person:hover { background: rgba(var(--accent-rgb),.06); }
.nb3-person-name { font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb3-avatar { flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--nb3-soft); color: var(--nb3-ink); font-weight: 700; }
.nb3-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nb3-muted { margin: 8px 6px; font-size: 13.5px; color: var(--text2); }
.nb3-link { padding: 0; border: 0; background: none; color: var(--nb3-ink); font: inherit; font-weight: 700; cursor: pointer; }
.nb3-search { display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--nb3-line); background: var(--bg); color: var(--text); font: inherit; }
.nb3-muted-row { display: flex; align-items: center; gap: 12px; padding: 6px 4px; }
.nb3-muted-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb3-muted-row .nb3-btn { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.nb3-muted-footer { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; }
.nb3-muted-footer:empty { display: none; }

/* ── Bells page (#settings/bells) ── */
.nb3-bells-page { color: var(--text); }
.nb3-bells-shell { max-width: 680px; margin: 0 auto; padding: 8px 16px 40px; box-sizing: border-box; }
.nb3-bells-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 4px; }
.nb3-back, .nb3-back-spacer { flex: 0 0 40px; width: 40px; height: 40px; }
.nb3-back { border-radius: 50%; border: 0; background: var(--nb3-soft); color: var(--text); font-size: 20px; cursor: pointer; }
.nb3-bells-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--text); }
.nb3-bells-title:focus { outline: none; }
.nb3-bells-intro { margin: 6px 4px 14px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--text2); }
.nb3-bells-list { list-style: none; margin: 0; padding: 0; }
.nb3-bell-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.nb3-bell-row:hover { background: rgba(var(--accent-rgb),.06); }
.nb3-bell-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb3-bell-level { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--text2); }
.nb3-bell-level.is-set { color: var(--nb3-ink); }
.nb3-bells-more { display: flex; justify-content: center; padding: 12px 0; }
.nb3-bells-more:empty { display: none; }
@media (max-width: 480px) {
  .nb3-settings.notif-settings-dialog { padding: 16px 12px; }
  .nb3-settings button.nb3-row, .nb3-row { padding: 11px 12px; gap: 10px; }
}

/* The unread dot sat under the row's ··· button; keep both visible (bell + history). */
#notificationCenter .notification-entry .notification-item { padding-right: 58px; }
#notificationCenter .notification-entry .notification-dot { right: 44px; }
/* The row menu has no visible title in the app; it keeps one for screen readers. */
.nb3-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* batch3-integration: white "Follow" on the plain accent measured 4.23:1 (needs 4.5). A slightly deeper
   accent keeps it the account's colour and readable for every accent. */
.notif-follow-back:not(.is-following) { background: color-mix(in srgb, var(--accent-primary, #7c3aed) 80%, #000); }
/* batch3-integration: light theme — accent ink on the soft accent tint measured 4.33:1 (Bells initials), and the
   red "Remove this notification" 3.76:1 on white. Deepen both to clear 4.5:1. */
body.light .nb3-settings, body.light .nb3-popup, body.light .nb3-bells-page { --nb3-ink: color-mix(in srgb, var(--accent-strong, #7c3aed) 82%, #000); }
body.light .nb3-menu-item.is-danger { color: #c81e1e; }
