.notif-stack{
  position:fixed;
  top:.9rem;
  left:50%;
  transform:translateX(-50%);
  z-index:1400;
  width:min(560px,calc(100vw - 1rem));
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.48rem;
  pointer-events:none;
}
.notif{
  pointer-events:auto;
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-columns:4px 38px minmax(0,1fr) 32px;
  align-items:center;
  min-height:62px;
  border-radius:14px;
  padding:.52rem .46rem .54rem 0;
  border:1px solid rgba(139,92,246,.28);
  background:linear-gradient(160deg,rgba(255,255,255,.97),rgba(245,240,255,.93));
  box-shadow:0 16px 34px rgba(18,9,35,.2),inset 0 1px 0 rgba(255,255,255,.7);
  animation:notifIn .26s cubic-bezier(.22,1,.36,1) forwards;
}
.notif.exit{animation:notifOut .22s ease forwards}
.notif::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(150deg,rgba(255,255,255,.32),rgba(255,255,255,0) 45%,rgba(139,92,246,.08));
}
.notif-rail{
  align-self:stretch;
  border-radius:12px 0 0 12px;
  background:linear-gradient(180deg,#8b5cf6,#7c3aed);
}
.notif-icon{
  width:30px;
  height:30px;
  margin-left:.46rem;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(139,92,246,.14);
  color:#6d28d9;
}
.notif.ok .notif-rail{background:linear-gradient(180deg,#34d399,#10b981)}
.notif.err .notif-rail{background:linear-gradient(180deg,#f87171,#ef4444)}
.notif.info .notif-rail{background:linear-gradient(180deg,#60a5fa,#3b82f6)}
.notif.warn .notif-rail{background:linear-gradient(180deg,#fbbf24,#f59e0b)}
.notif.ok .notif-icon{background:rgba(16,185,129,.16);color:#059669}
.notif.err .notif-icon{background:rgba(239,68,68,.14);color:#dc2626}
.notif.info .notif-icon{background:rgba(59,130,246,.14);color:#2563eb}
.notif.warn .notif-icon{background:rgba(245,158,11,.16);color:#d97706}
.notif-icon svg{width:15px;height:15px}
.notif-icon svg path.draw{stroke-dasharray:30;stroke-dashoffset:30;animation:notifDraw .45s .08s ease forwards}
.notif-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:.02rem;
  margin-left:.46rem;
}
.notif-title{
  font-size:.66rem;
  font-weight:760;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(43,29,69,.54);
}
.notif-text{
  font-size:.84rem;
  font-weight:620;
  line-height:1.3;
  color:#25183f;
  min-width:0;
  word-break:break-word;
}
.notif-close{
  width:28px;
  height:28px;
  border-radius:8px;
  border:1px solid transparent;
  background:transparent;
  color:rgba(43,29,69,.42);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:all .14s;
}
.notif-close:hover{
  color:#6d28d9;
  border-color:rgba(139,92,246,.2);
  background:rgba(139,92,246,.12);
}
.notif-close svg{width:11px;height:11px}
.notif-bar{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:2px;
  transform-origin:left;
  background:linear-gradient(90deg,#8b5cf6,#7c3aed);
}
.notif.ok .notif-bar{background:linear-gradient(90deg,#10b981,#34d399)}
.notif.err .notif-bar{background:linear-gradient(90deg,#ef4444,#f87171)}
.notif.info .notif-bar{background:linear-gradient(90deg,#3b82f6,#60a5fa)}
.notif.warn .notif-bar{background:linear-gradient(90deg,#f59e0b,#fbbf24)}
@keyframes notifIn{from{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes notifOut{from{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-12px) scale(.96)}}
@keyframes notifDraw{to{stroke-dashoffset:0}}
@keyframes notifBar{from{transform:scaleX(1)}to{transform:scaleX(0)}}
@media(max-width:640px){
  .notif-stack{top:.6rem;width:calc(100vw - .7rem)}
  .notif{
    min-height:58px;
    grid-template-columns:4px 34px minmax(0,1fr) 30px;
    padding:.45rem .38rem .48rem 0;
    border-radius:12px;
  }
  .notif-icon{
    width:28px;
    height:28px;
    margin-left:.4rem;
  }
  .notif-content{margin-left:.4rem}
  .notif-title{font-size:.62rem}
  .notif-text{font-size:.79rem}
}


.cfd-overlay{
  position:fixed;
  inset:0;
  z-index:1700;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1rem;
  background:rgba(12,8,26,.62);
  backdrop-filter:blur(12px) saturate(1.08);
  -webkit-backdrop-filter:blur(12px) saturate(1.08);
  animation:cfdBgIn .22s ease forwards;
}
.cfd-overlay.exit{animation:cfdBgOut .18s ease forwards}
.cfd-box{
  width:100%;
  max-width:410px;
  border-radius:22px;
  border:1px solid rgba(139,92,246,.26);
  background:linear-gradient(160deg,rgba(255,255,255,.98),rgba(246,240,255,.95));
  box-shadow:0 30px 70px rgba(16,8,32,.3),inset 0 1px 0 rgba(255,255,255,.72);
  overflow:hidden;
  position:relative;
  animation:cfdBoxIn .26s cubic-bezier(.22,1,.36,1) forwards;
}
.cfd-box::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(150deg,rgba(255,255,255,.32),rgba(255,255,255,0) 46%,rgba(139,92,246,.08));
}
.cfd-overlay.exit .cfd-box{animation:cfdBoxOut .18s ease forwards}
.cfd-top{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:.68rem;
  padding:1.06rem 1.1rem .66rem;
}
.cfd-ico{
  width:38px;
  height:38px;
  border-radius:11px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.cfd-ico.warn{background:rgba(245,158,11,.14)}
.cfd-ico.warn svg{color:#d97706}
.cfd-ico.danger{background:rgba(239,68,68,.14)}
.cfd-ico.danger svg{color:#dc2626}
.cfd-ico.info{background:rgba(59,130,246,.14)}
.cfd-ico.info svg{color:#2563eb}
.cfd-ico svg{width:20px;height:20px}
.cfd-title{
  font-size:.95rem;
  font-weight:760;
  letter-spacing:-.006em;
  color:#23163d;
  line-height:1.25;
}
.cfd-msg{
  position:relative;
  z-index:1;
  padding:0 1.1rem .82rem;
  font-size:.82rem;
  line-height:1.52;
  color:rgba(43,29,69,.66);
  white-space:pre-line;
}
.cfd-btns{
  position:relative;
  z-index:1;
  display:flex;
  gap:.45rem;
  padding:.66rem 1rem .92rem;
  justify-content:flex-end;
}
.cfd-btn{
  min-width:108px;
  height:38px;
  padding:0 .95rem;
  border-radius:11px;
  border:none;
  font-size:.8rem;
  font-weight:690;
  cursor:pointer;
  transition:all .14s;
  font-family:inherit;
}
.cfd-btn.cancel{
  background:rgba(139,92,246,.08);
  color:#584875;
  border:1px solid rgba(139,92,246,.22);
}
.cfd-btn.cancel:hover{
  background:rgba(139,92,246,.14);
  color:#3f2f5d;
}
.cfd-btn.ok{color:#fff}
.cfd-btn.ok.warn{background:linear-gradient(135deg,#f59e0b,#d97706);box-shadow:0 9px 18px rgba(245,158,11,.24)}
.cfd-btn.ok.warn:hover{box-shadow:0 11px 20px rgba(245,158,11,.32);transform:translateY(-1px)}
.cfd-btn.ok.danger{background:linear-gradient(135deg,#ef4444,#dc2626);box-shadow:0 9px 18px rgba(239,68,68,.22)}
.cfd-btn.ok.danger:hover{box-shadow:0 11px 20px rgba(239,68,68,.3);transform:translateY(-1px)}
.cfd-btn.ok.info{background:linear-gradient(135deg,#8b5cf6,#7c3aed);box-shadow:0 9px 18px rgba(139,92,246,.24)}
.cfd-btn.ok.info:hover{box-shadow:0 11px 20px rgba(139,92,246,.32);transform:translateY(-1px)}
@keyframes cfdBgIn{from{opacity:0}to{opacity:1}}
@keyframes cfdBgOut{from{opacity:1}to{opacity:0}}
@keyframes cfdBoxIn{from{opacity:0;transform:translateY(14px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes cfdBoxOut{from{opacity:1;transform:scale(1)}to{opacity:0;transform:translateY(8px) scale(.97)}}
@media(max-width:520px){
  .cfd-overlay{padding:.7rem}
  .cfd-box{border-radius:18px}
  .cfd-top{padding:.9rem .9rem .56rem}
  .cfd-msg{padding:0 .9rem .74rem;font-size:.78rem}
  .cfd-btns{padding:.56rem .82rem .8rem;gap:.4rem}
  .cfd-btn{min-width:0;flex:1;height:36px;font-size:.76rem}
}


html.dark .notif{
  border-color:rgba(167,139,250,.3);
  background:linear-gradient(160deg,rgba(30,22,54,.96),rgba(23,17,43,.94));
  box-shadow:0 18px 38px rgba(0,0,0,.44),inset 0 1px 0 rgba(196,181,253,.1);
}
html.dark .notif::before{
  background:linear-gradient(150deg,rgba(196,181,253,.12),rgba(167,139,250,0) 46%,rgba(20,14,39,.42));
}
html.dark .notif-title{color:rgba(232,228,240,.54)}
html.dark .notif-text{color:#ece6ff}
html.dark .notif-close{color:rgba(232,228,240,.46)}
html.dark .notif-close:hover{
  color:#e8dcff;
  border-color:rgba(167,139,250,.34);
  background:rgba(139,92,246,.24);
}
html.dark .cfd-overlay{background:rgba(4,3,12,.72);backdrop-filter:blur(12px)}
html.dark .cfd-box{
  background:linear-gradient(160deg,rgba(29,21,52,.96),rgba(23,17,42,.94));
  border-color:rgba(167,139,250,.3);
  box-shadow:0 34px 74px rgba(0,0,0,.5),inset 0 1px 0 rgba(196,181,253,.1);
}
html.dark .cfd-box::before{
  background:linear-gradient(150deg,rgba(196,181,253,.13),rgba(167,139,250,0) 46%,rgba(20,14,39,.42));
}
html.dark .cfd-title{color:#eee7ff}
html.dark .cfd-msg{color:rgba(232,228,240,.68)}
html.dark .cfd-btn.cancel{
  background:rgba(139,92,246,.2);
  color:rgba(232,228,240,.86);
  border-color:rgba(167,139,250,.32);
}
html.dark .cfd-btn.cancel:hover{background:rgba(139,92,246,.28);color:#f0e9ff}
