.ncg-floating-wrap,
.ncg-floating-wrap * {
  box-sizing: border-box;
}

.ncg-floating-wrap {
  --ncg-float-blue: #1877f2;
  --ncg-float-blue-dark: #0f62d6;
  --ncg-float-red: #e32636;
  --ncg-float-card: #ffffff;
  --ncg-float-text: #172235;
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 99990;
  width: 66px;
  height: 66px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.25;
  pointer-events: none;
}

.ncg-floating-link {
  position: relative;
  display: block;
  width: 66px;
  height: 66px;
  color: #fff !important;
  text-decoration: none !important;
  border: 0;
  border-radius: 50%;
  outline: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.ncg-floating-button {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #4397ff, var(--ncg-float-blue) 58%, var(--ncg-float-blue-dark));
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(24, 119, 242, 0.36), 0 3px 10px rgba(20, 40, 70, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ncg-floating-button svg {
  display: block;
  width: 42px;
  height: 42px;
  overflow: visible;
}

.ncg-floating-button svg > path:first-child {
  fill: rgba(255, 255, 255, 0.19);
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 2;
}

.ncg-floating-button .ncg-floating-mic {
  fill: #fff;
}

.ncg-floating-link:hover .ncg-floating-button,
.ncg-floating-link:focus-visible .ncg-floating-button {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 17px 34px rgba(24, 119, 242, 0.42), 0 4px 12px rgba(20, 40, 70, 0.22);
}

.ncg-floating-link:focus-visible .ncg-floating-button {
  outline: 4px solid rgba(24, 119, 242, 0.24);
  outline-offset: 3px;
}

.ncg-floating-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 4;
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 27px;
  text-align: center;
  background: var(--ncg-float-red);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 5px 13px rgba(160, 20, 35, 0.32);
}

.ncg-floating-notice {
  position: absolute;
  right: 79px;
  bottom: 8px;
  width: max-content;
  max-width: min(290px, calc(100vw - 120px));
  padding: 11px 15px;
  color: var(--ncg-float-text);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  background: var(--ncg-float-card);
  border: 1px solid rgba(24, 119, 242, 0.15);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(20, 40, 70, 0.19);
  animation: ncg-floating-notice-in 260ms ease both;
}

.ncg-floating-notice::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 17px;
  width: 13px;
  height: 13px;
  background: var(--ncg-float-card);
  border-top: 1px solid rgba(24, 119, 242, 0.15);
  border-right: 1px solid rgba(24, 119, 242, 0.15);
  transform: rotate(45deg);
}


.ncg-floating-link.has-unread .ncg-floating-notice {
  color: #fff;
  background: linear-gradient(145deg, #f34b5a, var(--ncg-float-red));
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 12px 30px rgba(227, 38, 54, 0.27);
}

.ncg-floating-link.has-unread .ncg-floating-notice::after {
  background: var(--ncg-float-red);
  border-color: rgba(255, 255, 255, 0.28);
}

.ncg-floating-link.has-unread .ncg-floating-button {
  background: linear-gradient(145deg, #ff5967, var(--ncg-float-red) 60%, #bd1525);
  box-shadow: 0 12px 30px rgba(227, 38, 54, 0.39), 0 3px 10px rgba(70, 10, 18, 0.18);
  animation: ncg-floating-pulse 2s ease-in-out infinite;
}

.ncg-floating-link.is-new-alert .ncg-floating-button {
  animation: ncg-floating-ring 680ms ease-out 1, ncg-floating-pulse 2s ease-in-out 680ms infinite;
}

.ncg-floating-wrap[data-ncg-theme="dark"] {
  --ncg-float-card: #1e2938;
  --ncg-float-text: #f5f8fc;
}

.ncg-floating-wrap[data-ncg-theme="dark"] .ncg-floating-badge {
  border-color: #16202c;
}

@keyframes ncg-floating-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 30px rgba(227, 38, 54, 0.39), 0 0 0 0 rgba(227, 38, 54, 0.32); }
  50% { transform: scale(1.045); box-shadow: 0 14px 34px rgba(227, 38, 54, 0.43), 0 0 0 12px rgba(227, 38, 54, 0); }
}

@keyframes ncg-floating-ring {
  0% { transform: scale(0.92); }
  45% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

@keyframes ncg-floating-notice-in {
  from { opacity: 0; transform: translateX(8px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 600px) {
  .ncg-floating-wrap {
    right: max(13px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
  }

  .ncg-floating-link,
  .ncg-floating-button {
    width: 56px;
    height: 56px;
  }

  .ncg-floating-button svg {
    width: 36px;
    height: 36px;
  }

  .ncg-floating-badge {
    top: -6px;
    right: -6px;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 24px;
  }

  .ncg-floating-notice {
    right: 67px;
    bottom: 5px;
    max-width: min(225px, calc(100vw - 93px));
    padding: 9px 12px;
    font-size: 12px;
    border-radius: 11px;
  }
}

@media (max-width: 370px) {
  .ncg-floating-notice {
    max-width: 190px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ncg-floating-link .ncg-floating-button,
  .ncg-floating-link.has-unread .ncg-floating-button,
  .ncg-floating-link.is-new-alert .ncg-floating-button,
  .ncg-floating-notice {
    animation: none !important;
    transition: none !important;
  }
}
