.ps-helper {
  position: fixed;
  left: var(--ps-helper-left, auto);
  right: var(--ps-helper-right, max(176px, env(safe-area-inset-right, 0px) + 160px));
  bottom: max(44px, env(safe-area-inset-bottom, 0px) + 28px);
  z-index: 92;
}

.ps-helper-overlay[hidden],
.ps-helper-panel[hidden] {
  display: none !important;
}

.ps-helper-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(11, 18, 34, 0.93);
  color: var(--ps-text);
  cursor: pointer;
  box-shadow:
    0 22px 40px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(16px);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.ps-helper-launcher-ring {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.55), rgba(99, 102, 241, 0.45)),
    radial-gradient(circle at 24% 24%, rgba(143, 183, 255, 0.18), transparent 56%);
  filter: blur(10px);
  opacity: 0.52;
  pointer-events: none;
  animation: ps-helper-glow 6.2s ease-in-out infinite;
}

.ps-helper-launcher-core {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 28% 26%, rgba(56, 189, 248, 0.19), transparent 52%),
    linear-gradient(180deg, rgba(19, 30, 49, 0.98), rgba(11, 18, 34, 0.97));
}

.ps-helper-launcher svg {
  width: 22px;
  height: 22px;
  color: rgba(243, 245, 251, 0.96);
}

.ps-helper-launcher:hover,
.ps-helper-launcher:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow:
    0 26px 50px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 24px rgba(56, 189, 248, 0.14);
}

.ps-helper-launcher:focus-visible,
.ps-helper-close:focus-visible,
.ps-helper-back:focus-visible,
.ps-helper-submit:focus-visible,
.ps-helper-overview-card:focus-visible,
.ps-helper-result-link:focus-visible,
.ps-helper-action-link:focus-visible,
.ps-helper-input:focus-visible,
.ps-helper-textarea:focus-visible,
.ps-helper-success:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.ps-helper-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.ps-helper.is-open .ps-helper-overlay {
  opacity: 1;
  pointer-events: auto;
}

.ps-helper-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 16px);
  display: flex;
  flex-direction: column;
  width: min(396px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(9, 13, 23, 0.985), rgba(7, 11, 19, 0.985));
  box-shadow:
    0 32px 70px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  backdrop-filter: blur(20px);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}

.ps-helper.is-open .ps-helper-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ps-helper-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(10, 14, 24, 0.98), rgba(10, 14, 24, 0.94));
}

.ps-helper-eyebrow {
  margin: 0;
  color: var(--ps-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ps-helper-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ps-text);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.ps-helper-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
}

.ps-helper-title-block {
  margin: 0 0 16px;
}

.ps-helper-title {
  margin: 0 0 6px;
  color: var(--ps-text);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.ps-helper-subtitle {
  margin: 0;
  color: var(--ps-text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.ps-helper-back-row {
  margin: 0 0 18px;
}

.ps-helper-back {
  appearance: none;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--ps-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ps-helper-back:hover,
.ps-helper-back:focus-visible {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.14);
}

.ps-helper-content,
.ps-helper-view {
  display: block;
}

.ps-helper-view[hidden] {
  display: none !important;
}

@keyframes ps-helper-glow {
  0%,
  100% {
    opacity: 0.44;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.64;
    transform: scale(1.02);
  }
}

@keyframes ps-helper-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .ps-helper-launcher {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .ps-helper-launcher-ring {
    filter: blur(6px);
    opacity: 0.42;
  }

  .ps-helper-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .ps-helper {
    left: auto;
    right: max(16px, env(safe-area-inset-right, 0px) + 10px);
    bottom: max(16px, env(safe-area-inset-bottom, 0px) + 12px);
  }

  .ps-helper-panel {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px) + 8px);
    left: 12px;
    width: auto;
    max-height: none;
    border-radius: 22px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  }

  .ps-helper-panel-body {
    padding: 16px;
  }

  .ps-helper-title {
    font-size: 22px;
  }

  .ps-helper-subtitle {
    font-size: 13px;
    line-height: 1.5;
  }

  .ps-helper-back-row {
    margin-bottom: 16px;
  }

  .ps-helper-back {
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-helper-launcher,
  .ps-helper-launcher-ring,
  .ps-helper-panel,
  .ps-helper-overlay {
    animation: none !important;
    transition: none !important;
  }
}
