/* The bell (includes/notif_bell.html, js/notif-bell.js): updates on the visitor's own salary. */

.ih-bell, .ih-bell-panel--sheet, .ih-bell-panel--float {
    --nb-bg: #1a1d23; --nb-border: rgba(255, 255, 255, 0.12); --nb-text: #eceef1; --nb-text-2: #c4c8ce;
    --nb-muted: #959ba3; --nb-accent: #6ea8fe; --nb-accent-bg: rgba(110, 168, 254, 0.14);
    --nb-unread: rgba(110, 168, 254, 0.08); --nb-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
html[data-theme="light"] .ih-bell, body.light-mode .ih-bell,
html[data-theme="light"] .ih-bell-panel--sheet, body.light-mode .ih-bell-panel--sheet,
html[data-theme="light"] .ih-bell-panel--float, body.light-mode .ih-bell-panel--float,
.ih-bell--home, .ih-bell-panel--home {
    --nb-bg: #ffffff; --nb-border: rgba(15, 23, 42, 0.12); --nb-text: #0f172a; --nb-text-2: #334155;
    --nb-muted: #64748b; --nb-accent: #1d4ed8; --nb-accent-bg: rgba(29, 78, 216, 0.08);
    --nb-unread: rgba(29, 78, 216, 0.05); --nb-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}
html[data-theme="dark"] .ih-bell--home, html[data-theme="dark"] .ih-bell-panel--home {
    --nb-bg: #1a1d23; --nb-border: rgba(255, 255, 255, 0.12); --nb-text: #eceef1; --nb-text-2: #c4c8ce;
    --nb-muted: #959ba3; --nb-accent: #6ea8fe; --nb-accent-bg: rgba(110, 168, 254, 0.14);
    --nb-unread: rgba(110, 168, 254, 0.08); --nb-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.ih-bell { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; }
.ih-bell[hidden] { display: none; }
.ih-bell--d { margin-right: 10px; }
.ih-bell--home { margin-right: 0; }

/* The button: same size and look as the header's theme switch beside it */
.ih-bell--d .ih-bell-btn:not(.icon-btn) {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; box-sizing: border-box; cursor: pointer;
    background: var(--color-bg-secondary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--color-border, var(--nb-border)); border-radius: var(--radius-lg, 8px);
    color: var(--color-text-secondary, var(--nb-text-2));
}
.ih-bell--d .ih-bell-btn:not(.icon-btn):hover,
.ih-bell.is-open .ih-bell-btn:not(.icon-btn) { border-color: var(--color-accent, var(--nb-accent)); color: var(--color-accent, var(--nb-accent)); }
.ih-bell-btn { position: relative; }
/* The phone salary calculator's header (a frame in the shell): a circle like its theme switch */
.ih-bell--m .ih-bell-btn:not(.shell-header__icon-btn):not(.icon-btn) {
    display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
    min-width: 32px; min-height: 32px; box-sizing: border-box; border-radius: 50%; cursor: pointer;
    background: var(--theme-bg-secondary, rgba(255, 255, 255, 0.06)); border: 1px solid var(--theme-border, var(--nb-border));
    color: var(--theme-text-secondary, var(--nb-text-2));
}
.ih-bell-btn:focus-visible { outline: 2px solid var(--nb-accent); outline-offset: 2px; }
.ih-bell-icon { display: block; }
.ih-bell--m .ih-bell-btn .ih-bell-icon { width: 15px; height: 15px; }
.ih-bell-count {
    position: absolute; top: -5px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
    border-radius: 999px; background: #ef4444; color: #fff; font: 700 10px/16px system-ui, sans-serif; text-align: center;
    box-shadow: 0 0 0 2px var(--nb-bg);
}
.ih-bell-count[hidden] { display: none; }

/* The panel: a dropdown under the bell on desktop */
.ih-bell-panel {
    position: absolute; top: calc(100% + 10px); right: -8px; z-index: 1000; width: 380px; max-height: min(560px, 75vh);
    display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box;
    background: var(--nb-bg); border: 1px solid var(--nb-border); border-radius: 14px; box-shadow: var(--nb-shadow);
    color: var(--nb-text); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; text-align: left;
}
.ih-bell-panel[hidden] { display: none; }
.ih-bell-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px 10px; border-bottom: 1px solid var(--nb-border);
}
.ih-bell-head strong { font-size: 14px; font-weight: 700; color: var(--nb-text); }
.ih-bell-close {
    width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--nb-muted);
    font-size: 20px; line-height: 1; cursor: pointer;
}
.ih-bell-close:hover { background: var(--nb-accent-bg); color: var(--nb-text); }
.ih-bell-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
.ih-bell-item {
    display: flex; flex-direction: column; gap: 3px; padding: 13px 16px 13px 18px; position: relative;
    border-bottom: 1px solid var(--nb-border);
}
.ih-bell-item:last-child { border-bottom: 0; }
.ih-bell-item.is-unread { background: var(--nb-unread); }
.ih-bell-item.is-unread::before {
    content: ''; position: absolute; left: 7px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--nb-accent);
}
.ih-bell-salary { font-size: 11.5px; color: var(--nb-muted); }
.ih-bell-title { font-size: 14px; font-weight: 650; line-height: 1.35; color: var(--nb-text); }
.ih-bell-text { font-size: 13px; line-height: 1.5; color: var(--nb-text-2); }
.ih-bell-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ih-bell-action {
    padding: 6px 12px; border: 1px solid var(--nb-accent); border-radius: 999px; cursor: pointer;
    background: var(--nb-accent-bg); color: var(--nb-accent); font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2;
}
.ih-bell-action:hover { background: var(--nb-accent); color: var(--nb-bg); }
.ih-bell-when { font-size: 11.5px; color: var(--nb-muted); white-space: nowrap; }
.ih-bell-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
/* "Turn off questions": quieter than the main action, still always visible */
.ih-bell-asks--off {
    padding: 4px 0; border: 0; background: none; cursor: pointer; color: var(--nb-muted);
    font-family: inherit; font-size: 12px; font-weight: 500; text-decoration: underline; text-underline-offset: 2px;
}
.ih-bell-asks--off:hover { color: var(--nb-text); }
.ih-bell-asks:disabled { opacity: .6; cursor: progress; }
/* Nothing to show: "Checking…", "Nothing new", or "Add your salary" for someone who hasn't */
.ih-bell-empty { display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 18px 18px; }
.ih-bell-empty .ih-bell-row { justify-content: flex-start; margin-top: 8px; }
.ih-bell-panel--sheet .ih-bell-empty { padding: 18px 18px 20px 22px; }
.ih-bell-foot { margin: 0; padding: 10px 16px 12px; border-top: 1px solid var(--nb-border); font-size: 11.5px; color: var(--nb-muted); }
.ih-bell-profile { margin-left: 4px; color: var(--nb-accent); font-weight: 600; white-space: nowrap; text-decoration: none; }
.ih-bell-profile:hover { text-decoration: underline; }

/* Desktop, once shown: floats over the page under the bell (top/right set by notif-bell.js) */
.ih-bell-panel--float { position: fixed; z-index: 10041; }

/* Phone shell: a bottom sheet */
.ih-bell-backdrop { position: fixed; inset: 0; z-index: 10040; background: rgba(0, 0, 0, 0.5); }
.ih-bell-backdrop[hidden] { display: none; }
.ih-bell-panel--sheet {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 10041; width: auto; max-height: 82vh;
    border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0);
}
.ih-bell-panel--sheet .ih-bell-head { padding: 16px 18px 12px; }
.ih-bell-panel--sheet .ih-bell-head strong { font-size: 15px; }
.ih-bell-panel--sheet .ih-bell-item { padding: 14px 18px 14px 22px; }
.ih-bell-panel--sheet .ih-bell-item.is-unread::before { left: 9px; top: 20px; }
.ih-bell-panel--sheet .ih-bell-action { padding: 8px 14px; font-size: 13px; }
html.ih-bell-sheet-open, html.ih-bell-sheet-open body { overflow: hidden; }

/* The phone salary calculator's header gets one more button with the bell: keep its "Salary Calculator"
   subtitle on one line (it fits; it only wrapped because it could) */
.bloomberg-mobile header:has(.ih-bell:not([hidden])) .logo-title-sub { white-space: nowrap; }

/* Home page header: the bell is one more control in a full row. Tighter spacing makes room at
   desktop widths; the logo keeps its size and the section links scroll sideways if space still
   runs out (as they already do on tablets) */
.site-head__row:has(.ih-bell:not([hidden])) { gap: 20px; }
.site-head__row:has(.ih-bell:not([hidden])) .site-head__end { gap: 10px; }
.site-head__row:has(.ih-bell:not([hidden])) .brand { flex-shrink: 0; }
.site-head__row:has(.ih-bell:not([hidden])) .site-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
