
:root{
  --qsN-bg:#ffffff;
  --qsN-text:#0f172a;
  --qsN-muted:#667085;
  --qsN-border:rgba(0, 51, 102, 0.10);
  --qsN-border-strong:rgba(0, 51, 102, 0.16);
  --qsN-primary:#0094ff;
  --qsN-primary-strong:#003366;
  --qsN-surface:#f7fbff;
  --qsN-surface-soft:#eef7ff;
  --qsN-shadow:0 18px 40px rgba(0, 24, 58, 0.16);
  --qsN-shadow-soft:0 10px 26px rgba(0, 24, 58, 0.10);
}

/* Overlay */
.qs-notif-overlay{
  position:fixed;
  inset:0;
  background:rgba(6, 24, 44, 0.34);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  opacity:0;
  pointer-events:none;
  transition:opacity .20s ease;
  z-index:10060;
}
.qs-notif-overlay.open{
  opacity:1;
  pointer-events:auto;
}

body.qs-modal-open{ overflow:hidden; }

/* Panel */
.qs-notif-panel{
  position:fixed;
  top:64px;
  right:16px;
  width:clamp(340px, 29vw, 412px);
  max-width:calc(100vw - 32px);
  max-height:calc(100vh - 88px);
  background:linear-gradient(180deg, rgba(255,255,255,0.99), rgba(247,251,255,0.98));
  border:1px solid var(--qsN-border);
  border-radius:22px;
  box-shadow:var(--qsN-shadow);
  overflow:hidden;
  opacity:0;
  transform:translateY(-8px) scale(.985);
  pointer-events:none;
  transition:opacity .20s ease, transform .20s ease;
  z-index:10061;
}
.qs-notif-panel::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:82px;
  background:linear-gradient(180deg, rgba(0,148,255,0.10), rgba(0,148,255,0));
  pointer-events:none;
}
.qs-notif-panel.open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
.qs-notif-panel[data-has-embed-close="1"] .qsN-fixed-close{
  display:none;
}

.qsN-fixed-close{
  position:absolute;
  top:14px;
  right:14px;
  z-index:3;
}

.qsN-content{
  position:relative;
  height:100%;
}

/* States */
.qsN-loading,
.qsN-error{
  min-height:220px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:28px 22px 24px;
  text-align:center;
  color:var(--qsN-text);
}

.qsN-loading-card,
.qsN-error-icon{
  width:56px;
  height:56px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(237,247,255,0.96));
  border:1px solid var(--qsN-border);
  box-shadow:var(--qsN-shadow-soft);
  color:var(--qsN-primary-strong);
}
.qsN-loading-card{
  gap:6px;
}
.qsN-loading-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(0,148,255,0.9), rgba(0,51,102,0.85));
  animation:qsN-bounce 1s infinite ease-in-out;
}
.qsN-loading-dot:nth-child(2){ animation-delay:.12s; }
.qsN-loading-dot:nth-child(3){ animation-delay:.24s; }

.qsN-loading-label{
  color:var(--qsN-muted);
  font-size:14px;
  font-weight:700;
}

.qsN-error-icon{
  font-weight:900;
  font-size:24px;
}
.qsN-error-title{
  font-weight:850;
  font-size:16px;
}
.qsN-error-text{
  color:var(--qsN-muted);
  font-weight:600;
  line-height:1.45;
  max-width:28ch;
}
.qsN-error-actions{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}
.qsN-retry{
  appearance:none;
  border:1px solid var(--qsN-border);
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(237,247,255,0.96));
  color:var(--qsN-primary-strong);
  border-radius:12px;
  min-height:42px;
  padding:0 14px;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  box-shadow:var(--qsN-shadow-soft);
}
.qsN-retry:hover{
  background:rgba(237,247,255,0.96);
}

/* Embed content */
.qsN-root{
  position:relative;
  z-index:1;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--qsN-text);
  display:flex;
  flex-direction:column;
  min-height:min(520px, calc(100vh - 88px));
}
.qsN-root--visitor .qsN-title-row .qsN-unread-badge{
  background:rgba(0, 51, 102, 0.06);
}

.qsN-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:18px 18px 12px;
}
.qsN-top-main{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-width:0;
}
.qsN-icon-bubble{
  width:44px;
  height:44px;
  border-radius:15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(237,247,255,0.96));
  border:1px solid var(--qsN-border);
  box-shadow:var(--qsN-shadow-soft);
  color:var(--qsN-primary-strong);
  flex:0 0 auto;
}
.qsN-title-icon{
  width:21px;
  height:21px;
  display:block;
}
.qsN-heading{
  min-width:0;
}
.qsN-eyebrow{
  font-size:11px;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--qsN-muted);
  font-weight:800;
  margin-bottom:4px;
}
.qsN-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.qsN-title{
  font-weight:900;
  font-size:18px;
  line-height:1.15;
  color:var(--qsN-primary-strong);
}
.qsN-unread-badge{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(0, 51, 102, 0.05);
  border:1px solid rgba(0, 51, 102, 0.08);
  color:var(--qsN-muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.qsN-unread-badge.is-active{
  background:rgba(0, 148, 255, 0.12);
  border-color:rgba(0, 148, 255, 0.22);
  color:var(--qsN-primary-strong);
}
.qsN-sub{
  margin-top:6px;
  color:var(--qsN-muted);
  font-size:13px;
  line-height:1.4;
  font-weight:600;
}

.qsN-close{
  appearance:none;
  border:1px solid var(--qsN-border);
  background:rgba(255,255,255,0.94);
  color:var(--qsN-primary-strong);
  border-radius:12px;
  width:40px;
  height:40px;
  cursor:pointer;
  font-size:20px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 18px rgba(0, 24, 58, 0.10);
  transition:background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.qsN-close:hover,
.qsN-close:focus-visible{
  background:rgba(237,247,255,0.98);
  border-color:var(--qsN-border-strong);
  transform:translateY(-1px);
  outline:none;
}

.qsN-actions{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:0 18px 14px;
  flex-wrap:wrap;
}
.qsN-actions .inline{
  margin:0;
}
.qsN-btn{
  appearance:none;
  border:1px solid var(--qsN-border);
  background:rgba(255,255,255,0.98);
  color:var(--qsN-primary-strong);
  border-radius:12px;
  min-height:42px;
  padding:0 14px;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:13px;
  box-shadow:0 8px 18px rgba(0, 24, 58, 0.06);
  transition:background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.qsN-btn:hover,
.qsN-btn:focus-visible{
  background:rgba(237,247,255,0.98);
  border-color:var(--qsN-border-strong);
  transform:translateY(-1px);
  outline:none;
}
.qsN-btn--primary{
  background:linear-gradient(180deg, rgba(0,148,255,0.14), rgba(0,148,255,0.10));
  border-color:rgba(0, 148, 255, 0.26);
}
.qsN-btn--ghost{
  background:rgba(0, 51, 102, 0.04);
  box-shadow:none;
}


.qsN-tab-rail{
  position:relative;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:0 18px 14px;
}
.qsN-tab-rail::before,
.qsN-tab-rail::after{
  content:"";
  position:absolute;
  top:0;
  bottom:14px;
  width:28px;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
}
.qsN-tab-rail::before{
  left:52px;
  background:linear-gradient(90deg, rgba(247,251,255,0.98), rgba(247,251,255,0));
}
.qsN-tab-rail::after{
  right:52px;
  background:linear-gradient(270deg, rgba(247,251,255,0.98), rgba(247,251,255,0));
}
.qsN-tab-rail:not(.is-start)::before{ opacity:1; }
.qsN-tab-rail:not(.is-end)::after{ opacity:1; }

.qsN-tab-scroll{
  appearance:none;
  border:1px solid var(--qsN-border);
  background:rgba(255,255,255,0.98);
  color:var(--qsN-primary-strong);
  width:38px;
  height:38px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 18px rgba(0, 24, 58, 0.06);
  cursor:pointer;
  transition:background-color .18s ease, border-color .18s ease, transform .18s ease, opacity .18s ease;
}
.qsN-tab-scroll svg{
  width:18px;
  height:18px;
  display:block;
}
.qsN-tab-scroll:hover,
.qsN-tab-scroll:focus-visible{
  background:rgba(237,247,255,0.98);
  border-color:var(--qsN-border-strong);
  transform:translateY(-1px);
  outline:none;
}
.qsN-tab-scroll[disabled]{
  opacity:.42;
  cursor:default;
  transform:none;
}
.qsN-tab-scroll[hidden]{
  display:none;
}

.qsN-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  min-width:0;
  padding:0 2px 2px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  scroll-behavior:smooth;
  scroll-snap-type:x proximity;
}
.qsN-tabs::-webkit-scrollbar{ display:none; }
.qsN-tab{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid var(--qsN-border);
  background:rgba(255,255,255,0.96);
  color:var(--qsN-primary-strong);
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
  text-decoration:none;
  scroll-snap-align:start;
  transition:background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.qsN-tab:hover,
.qsN-tab:focus-visible{
  background:rgba(237,247,255,0.98);
  border-color:var(--qsN-border-strong);
  transform:translateY(-1px);
  outline:none;
}
.qsN-tab.active{
  background:linear-gradient(180deg, rgba(0,148,255,0.14), rgba(0,148,255,0.08));
  border-color:rgba(0, 148, 255, 0.26);
  box-shadow:0 10px 18px rgba(0, 148, 255, 0.10);
}
.qsN-tab__label{
  display:inline-flex;
  align-items:center;
}
.qsN-tab__count{
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:rgba(0, 51, 102, 0.08);
  color:var(--qsN-primary-strong);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:900;
}
.qsN-tab.active .qsN-tab__count{
  background:rgba(255,255,255,0.78);
}

.qsN-list{
  padding:0 18px 18px;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:auto;
  min-height:0;
  max-height:calc(100vh - 260px);
}

.qsN-item{
  position:relative;
  border:1px solid var(--qsN-border);
  border-radius:18px;
  padding:14px;
  display:grid;
  gap:12px;
  background:rgba(255,255,255,0.96);
  box-shadow:0 8px 18px rgba(0, 24, 58, 0.05);
}
.qsN-item::before{
  content:"";
  position:absolute;
  left:10px;
  top:14px;
  bottom:14px;
  width:4px;
  border-radius:999px;
  background:transparent;
}
.qsN-item.unread{
  border-color:rgba(0, 148, 255, 0.22);
  box-shadow:0 14px 26px rgba(0, 148, 255, 0.08);
}
.qsN-item.unread::before{
  background:linear-gradient(180deg, rgba(0,148,255,0.92), rgba(0,51,102,0.88));
}
.qsN-item.read{
  background:rgba(255,255,255,0.90);
}
.qsN-item-main{
  padding-left:10px;
  display:grid;
  gap:10px;
}
.qsN-copy{
  display:grid;
  gap:6px;
}
.qsN-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.qsN-pill{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--qsN-border);
  background:rgba(0, 51, 102, 0.04);
  color:var(--qsN-primary-strong);
  font-size:12px;
  font-weight:850;
}
.qsN-pill--orders{ background:rgba(0,148,255,0.10); }
.qsN-pill--payments{ background:rgba(34,197,94,0.10); }
.qsN-pill--system{ background:rgba(0,51,102,0.06); }
.qsN-pill--security{ background:rgba(245,158,11,0.14); }
.qsN-pill--marketplace{ background:rgba(168,85,247,0.12); }

.qsN-date{
  color:var(--qsN-muted);
  font-size:12px;
  font-weight:700;
}

.qsN-item-title{
  font-weight:900;
  font-size:15px;
  line-height:1.3;
  color:var(--qsN-primary-strong);
}
.qsN-body{
  color:#334155;
  font-size:13px;
  line-height:1.5;
  font-weight:500;
}

.qsN-item-actions{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.qsN-done{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:0 12px;
  border-radius:999px;
  background:rgba(0, 51, 102, 0.05);
  color:var(--qsN-muted);
  font-weight:800;
  font-size:13px;
}

.qsN-empty{
  border:1px dashed rgba(0, 51, 102, 0.16);
  border-radius:18px;
  padding:26px 18px;
  text-align:center;
  color:var(--qsN-muted);
  background:rgba(255,255,255,0.94);
  display:grid;
  gap:10px;
}
.qsN-empty__icon{
  width:52px;
  height:52px;
  margin:0 auto;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(237,247,255,0.96));
  border:1px solid var(--qsN-border);
  box-shadow:var(--qsN-shadow-soft);
  color:var(--qsN-primary-strong);
}
.qsN-empty__icon svg{
  width:22px;
  height:22px;
  display:block;
}
.qsN-empty__title{
  font-size:16px;
  font-weight:900;
  color:var(--qsN-primary-strong);
}
.qsN-empty__text{
  font-size:13px;
  line-height:1.5;
  font-weight:600;
}

/* Mobile drawer */
@media (max-width: 768px){
  .qs-notif-panel{
    top:0;
    right:0;
    bottom:0;
    width:min(420px, 100vw);
    max-width:100vw;
    max-height:100vh;
    height:100dvh;
    border-radius:28px 0 0 28px;
    border-right:0;
    transform:translateX(100%);
    opacity:1;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .qs-notif-panel::before{
    height:96px;
  }
  .qs-notif-panel.open{
    transform:translateX(0);
  }
  .qsN-root{
    min-height:100dvh;
  }
  .qsN-top{
    padding-top:calc(18px + env(safe-area-inset-top));
  }
  .qsN-list{
    max-height:none;
    padding-bottom:calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px){
  .qsN-top,
  .qsN-actions,
  .qsN-tab-rail,
  .qsN-list{
    padding-left:14px;
    padding-right:14px;
  }
  .qsN-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .qsN-actions .inline,
  .qsN-actions .qsN-btn{
    width:100%;
  }
  .qsN-actions .inline .qsN-btn{
    width:100%;
  }
  .qsN-tab-scroll{
    width:34px;
    height:34px;
  }
  .qsN-tab{
    min-height:36px;
    padding:0 11px;
  }
  .qsN-item{
    padding:13px;
  }
  .qsN-item-main{
    padding-left:8px;
  }
}

@keyframes qsN-bounce{
  0%, 80%, 100%{ transform:translateY(0); opacity:.45; }
  40%{ transform:translateY(-4px); opacity:1; }
}


/* E5 micro-polish: modal header + action alignment */
.qsN-top{
  align-items:flex-start;
  gap:16px;
}
.qsN-top-main{
  flex:1 1 auto;
}
.qsN-heading{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}
.qsN-title-row{
  justify-content:flex-start;
}
.qsN-sub{
  max-width:34ch;
  text-align:left;
}

.qsN-close{
  flex:0 0 42px;
  min-width:42px;
  width:42px;
  height:42px;
  aspect-ratio:1 / 1;
  padding:0;
  border-radius:14px;
  align-self:flex-start;
  font-size:22px;
  font-weight:700;
  line-height:1;
}

.qsN-actions{
  align-items:flex-start;
  justify-content:space-between;
  gap:12px 14px;
  padding:2px 18px 14px;
}
.qsN-actions-copy{
  min-width:0;
  flex:1 1 220px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
}
.qsN-actions-title{
  color:var(--qsN-primary-strong);
  font-size:14px;
  font-weight:850;
  line-height:1.25;
}
.qsN-actions-meta{
  color:var(--qsN-muted);
  font-size:12px;
  line-height:1.35;
  font-weight:600;
  text-align:left;
}
.qsN-actions-controls{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-start;
  gap:10px;
  flex:0 0 auto;
}

@media (max-width: 640px){
  .qsN-top{
    gap:12px;
  }
  .qsN-close{
    flex-basis:40px;
    min-width:40px;
    width:40px;
    height:40px;
  }
  .qsN-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .qsN-actions-controls{
    width:100%;
    justify-content:stretch;
  }
  .qsN-actions-controls .inline,
  .qsN-actions-controls .qsN-btn{
    flex:1 1 auto;
  }
}


/* Embed / Drawer finish */
.qs-notif-panel .qsN-root{
  height:100%;
  min-height:0;
}
.qs-notif-panel .qsN-list{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
}

.qsN-embed-context{
  margin:0 18px 14px;
  padding:15px 16px;
  border-radius:18px;
  border:1px solid var(--qsN-border);
  background:linear-gradient(180deg, rgba(245,250,255,0.98), rgba(255,255,255,0.96));
  box-shadow:var(--qsN-shadow-soft);
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:14px;
  align-items:start;
}
.qsN-embed-context__main{
  min-width:0;
  display:grid;
  gap:6px;
}
.qsN-embed-context__eyebrow{
  font-size:11px;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--qsN-muted);
  font-weight:800;
}
.qsN-embed-context__title{
  font-size:20px;
  line-height:1.08;
  font-weight:900;
  color:var(--qsN-primary-strong);
}
.qsN-embed-context__text{
  color:var(--qsN-muted);
  font-size:13px;
  line-height:1.45;
  font-weight:600;
}
.qsN-embed-context__meta{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
.qsN-embed-context__pill,
.qsN-action-scope{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 12px;
  border-radius:999px;
  background:rgba(0, 51, 102, 0.05);
  border:1px solid rgba(0, 51, 102, 0.08);
  color:var(--qsN-primary-strong);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.qsN-embed-context__pill--status.is-active{
  background:rgba(0, 148, 255, 0.12);
  border-color:rgba(0, 148, 255, 0.22);
}

.qsN-actions-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.qsN-actions--embed{
  margin:0 18px 14px;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid var(--qsN-border);
  background:rgba(255,255,255,0.96);
  box-shadow:var(--qsN-shadow-soft);
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:14px;
  align-items:start;
}
.qsN-actions-copy--embed{
  min-width:0;
  display:grid;
  gap:6px;
}
.qsN-actions-controls--embed{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
.qsN-actions-controls--embed .inline{
  margin:0;
}
.qsN-actions-controls--embed .qsN-btn{
  min-width:154px;
}

@media (max-width: 700px){
  .qsN-top{
    padding:16px 16px 10px;
  }
  .qsN-top-main{
    gap:10px;
  }
  .qsN-embed-context,
  .qsN-actions--embed{
    margin:0 16px 12px;
    padding:14px;
  }
  .qsN-embed-context,
  .qsN-actions--embed{
    grid-template-columns:1fr;
  }
  .qsN-embed-context__meta,
  .qsN-actions-controls--embed{
    justify-content:flex-start;
  }
  .qsN-actions-controls--embed .qsN-btn{
    min-width:0;
    flex:1 1 100%;
  }
  .qsN-tab-rail{
    padding:0 16px 12px;
  }
  .qsN-list{
    padding:0 16px 16px;
  }
}

@media (max-width: 420px){
  .qsN-title-row{
    gap:8px;
  }
  .qsN-embed-context__title{
    font-size:18px;
  }
  .qsN-sub,
  .qsN-embed-context__text,
  .qsN-actions-meta{
    font-size:12px;
  }
}
