:root {
  --native-push-surface: hsl(224 40% 16% / 0.98);
  --native-push-surface-soft: hsl(221 43% 20% / 0.98);
  --native-push-border: hsl(var(--white) / 0.12);
  --native-push-muted: hsl(var(--white) / 0.66);
  --native-push-shadow: 0 22px 60px hsl(230 70% 4% / 0.42);
}

.native-push-prompt,
.native-alert-hub {
  color: hsl(var(--white));
  font-family: inherit;
}

.native-push-prompt[hidden],
.native-alert-panel[hidden],
.native-alert-badge[hidden] {
  display: none !important;
}

.native-push-prompt {
  position: fixed;
  z-index: 1090;
  left: 20px;
  bottom: 20px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  width: min(440px, calc(100vw - 40px));
  padding: 20px 46px 20px 20px;
  border: 1px solid hsl(var(--base-two) / 0.38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, hsl(var(--base-two) / 0.2), transparent 45%),
    var(--native-push-surface);
  box-shadow: var(--native-push-shadow);
}

.native-push-prompt__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid hsl(var(--base-two) / 0.38);
  border-radius: 13px;
  background: hsl(var(--base-two) / 0.14);
  color: hsl(var(--base-two));
  font-size: 1.45rem;
}

.native-push-prompt__content h2 {
  margin: 0 0 6px;
  color: hsl(var(--white));
  font-size: 1.06rem;
  line-height: 1.35;
}

.native-push-prompt__content > p {
  margin: 0;
  color: var(--native-push-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.native-push-prompt__status:not(:empty) {
  margin-top: 9px;
  color: hsl(42 96% 68%);
}

.native-push-prompt__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.native-push-prompt__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
}

.native-push-prompt__close,
.native-push-text-button,
.native-alert-panel__header-actions button {
  border: 0;
  background: transparent;
  color: var(--native-push-muted);
}

.native-push-prompt__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 1.15rem;
}

.native-push-prompt__close:hover,
.native-push-prompt__close:focus-visible,
.native-alert-panel__header-actions button:hover,
.native-alert-panel__header-actions button:focus-visible {
  background: hsl(var(--white) / 0.08);
  color: hsl(var(--white));
}

.native-push-text-button {
  padding: 8px 4px;
  font-size: 0.84rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.native-alert-hub {
  position: fixed;
  z-index: 1080;
  right: 20px;
  bottom: 88px;
}

.native-alert-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid hsl(var(--base-two) / 0.44);
  border-radius: 16px;
  background: linear-gradient(135deg, hsl(var(--base-two) / 0.92), hsl(var(--base) / 0.94));
  box-shadow: 0 14px 34px hsl(230 70% 4% / 0.36);
  color: hsl(var(--white));
  font-size: 1.45rem;
}

.native-alert-bell:hover,
.native-alert-bell:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px hsl(230 70% 4% / 0.44);
}

.native-alert-bell:focus-visible,
.native-push-prompt button:focus-visible,
.native-alert-panel button:focus-visible,
.native-alert-item__link:focus-visible {
  outline: 3px solid hsl(42 96% 62% / 0.82);
  outline-offset: 3px;
}

.native-alert-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 2px solid hsl(224 40% 16%);
  border-radius: 999px;
  background: hsl(3 85% 60%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.native-alert-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  overflow: hidden;
  width: min(410px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 130px));
  border: 1px solid var(--native-push-border);
  border-radius: 20px;
  background: var(--native-push-surface);
  box-shadow: var(--native-push-shadow);
}

.native-alert-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 15px;
  border-bottom: 1px solid hsl(var(--white) / 0.08);
  background: linear-gradient(120deg, hsl(var(--base-two) / 0.14), transparent 60%);
}

.native-alert-panel__eyebrow {
  color: hsl(var(--base-two));
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.native-alert-panel__header h2 {
  margin: 2px 0 0;
  color: hsl(var(--white));
  font-size: 1.12rem;
}

.native-alert-panel__header-actions {
  display: flex;
  gap: 5px;
}

.native-alert-panel__header-actions button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.25rem;
}

.native-alert-panel__status {
  padding: 22px 18px;
  color: var(--native-push-muted);
  font-size: 0.86rem;
  text-align: center;
}

.native-alert-panel__status:empty {
  display: none;
}

.native-alert-list {
  overflow-y: auto;
  max-height: min(545px, calc(100vh - 230px));
  margin: 0;
  padding: 8px;
  list-style: none;
  overscroll-behavior: contain;
}

.native-alert-item {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 30px;
  gap: 10px;
  padding: 13px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.native-alert-item + .native-alert-item {
  margin-top: 4px;
}

.native-alert-item:hover,
.native-alert-item:focus-within {
  border-color: hsl(var(--white) / 0.09);
  background: hsl(var(--white) / 0.045);
}

.native-alert-item.is-unread {
  background: hsl(var(--base-two) / 0.08);
}

.native-alert-item__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid hsl(var(--base-two) / 0.28);
  border-radius: 10px;
  background: hsl(var(--base-two) / 0.12);
  color: hsl(var(--base-two));
  font-size: 1.05rem;
}

.native-alert-item__link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.native-alert-item__link strong,
.native-alert-item__link span,
.native-alert-item__link time {
  display: block;
}

.native-alert-item__link strong {
  padding-right: 36px;
  color: hsl(var(--white));
  font-size: 0.88rem;
  line-height: 1.35;
}

.native-alert-item__link span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--native-push-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.native-alert-item__link time {
  margin-top: 7px;
  color: hsl(var(--white) / 0.46);
  font-size: 0.7rem;
}

.native-alert-item__new {
  position: absolute;
  top: 13px;
  right: 45px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: hsl(42 96% 62%);
  box-shadow: 0 0 0 4px hsl(42 96% 62% / 0.12);
}

.native-alert-item__dismiss {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: hsl(var(--white) / 0.5);
}

.native-alert-item__dismiss:hover,
.native-alert-item__dismiss:focus-visible {
  background: hsl(3 85% 60% / 0.12);
  color: hsl(3 85% 68%);
}

@media (max-width: 575px) {
  .native-push-prompt {
    right: 12px;
    bottom: 12px;
    left: 12px;
    grid-template-columns: 42px minmax(0, 1fr);
    width: auto;
    padding: 17px 42px 17px 15px;
  }

  .native-push-prompt__icon {
    width: 36px;
    height: 36px;
  }

  .native-alert-hub {
    right: 14px;
    bottom: 76px;
  }

  .native-alert-panel {
    position: fixed;
    right: 10px;
    bottom: 72px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 92px);
  }

  .native-alert-list {
    max-height: calc(100vh - 190px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .native-push-prompt,
  .native-alert-panel {
    animation: native-push-enter 0.2s ease-out;
  }

  .native-alert-bell {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
}

@keyframes native-push-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-contrast: more) {
  .native-push-prompt,
  .native-alert-panel,
  .native-alert-bell {
    border-width: 2px;
  }
}
