  .notif-trigger {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--panel-border, rgba(255,255,255,.12));
    background: rgba(255,255,255,.04);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 8px;
  }
  .notif-trigger .notif-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
  }
  .notif-trigger .notif-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
  }
  .notif-badge {
    position: absolute;
    top: -4px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }
  .notif-badge.show { display: inline-flex; }
  .notif-panel {
    position: fixed; /* escape stacking contexts and sit above other elements */
    right: auto;
    top: auto;
    left: auto;
    width: min(360px, calc(100vw - 24px));
    max-height: 420px;
    border-radius: 12px;
    border: 1px solid var(--panel-border, rgba(255,255,255,.1));
    background: var(--surface, #0b0d10);
    box-shadow: 0 14px 34px rgba(2,6,23,.55);
    display: none;
    overflow: hidden;
    z-index: 24030; /* sufficiently high to be above most UI elements */
  }
  .notif-panel.open { display: block; }
  .notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .notif-readall {
    border: 0;
    background: rgba(255,255,255,0.03);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 6px 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .notif-list {
    max-height: 320px;
    overflow: auto;
    display: grid;
  }
  .notif-item {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: grid;
    gap: 4px;
  }
  .notif-item.clickable { cursor: pointer; transition: background .12s ease; }
  .notif-item.clickable:hover { background: rgba(88,138,255,.08); }
  .notif-item.unread { background: rgba(88,138,255,.10); }
  .notif-item strong { font-size: .92rem; }
  .notif-item p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.35; }
  .notif-item small { color: var(--muted); font-size: .76rem; }
  .notif-actions { display:flex; gap:8px; margin-top:4px; }
  .notif-action-btn { border:1px solid var(--panel-border, rgba(255,255,255,.18)); background:rgba(255,255,255,.05); color:var(--text); border-radius:8px; padding:5px 10px; font-size:.8rem; cursor:pointer; }
  .notif-action-btn.accept { border-color:rgba(16,185,129,.55); color:#a7f3d0; }
  .notif-action-btn.decline { border-color:rgba(239,68,68,.55); color:#fecaca; }
  .notif-action-btn[disabled] { opacity:.65; cursor:default; }
  .notif-empty { padding: 14px 12px; color: var(--muted); font-size: .9rem; }
  .notif-footer {
    display: block;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255,255,255,.03);
    border-top: 1px solid rgba(255,255,255,.08);
  }
  @media (max-width:900px) {
    .notif-panel { right: 0; top: calc(100% + 10px); }
  }
  @media (max-width:480px) {
    .notif-trigger {
      width: 34px;
      height: 34px;
      margin-right: 4px;
    }
    .notif-trigger .notif-icon {
      width: 18px;
      height: 18px;
    }
    .notif-panel {
      width: min(320px, calc(100vw - 12px));
      right: 2px;
      top: calc(100% + 6px);
    }
    /* keep compact layout (global rules cover desktop and mobile) */
    .notif-head strong { font-size:0.95rem; }
  }
  @media (max-width:360px) {
    .notif-trigger {
      width: 32px;
      height: 32px;
      margin-right: 2px;
    }
    .notif-trigger .notif-icon {
      width: 17px;
      height: 17px;
    }
    .notif-panel {
      width: min(300px, calc(100vw - 8px));
      right: 0;
    }
    /* Very small screens: slightly reduce sizes */
    .notif-head { padding:6px 8px; gap:6px; }
    .notif-readall { font-size:0.75rem; padding:5px 7px; border-radius:7px; }
  }
