.feedback-prompt {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  width: min(460px, calc(100vw - 40px));
  color: var(--text, #e5e7eb);
  background: linear-gradient(145deg, #182334 0%, #111827 100%);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .42), 0 0 0 1px rgba(59, 130, 246, .08);
  overflow: hidden;
}

.feedback-prompt[hidden] {
  display: none;
}

.feedback-prompt-inner {
  padding: 22px;
}

.feedback-prompt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.feedback-prompt-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.feedback-prompt-close {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
}

.feedback-prompt-close:hover,
.feedback-prompt-close:focus-visible {
  border-color: var(--border, #64748b);
  background: rgba(148, 163, 184, .12);
}

.feedback-prompt-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-prompt-form-actions button {
  min-height: 40px;
}

.feedback-prompt-rating {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.feedback-prompt-legend {
  margin: 0;
}

.feedback-prompt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.feedback-prompt-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.feedback-prompt-star {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 58px;
  padding: 4px;
  color: #94a3b8;
  cursor: pointer;
  touch-action: manipulation;
}

.feedback-prompt-star input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.feedback-prompt-star > span[aria-hidden="true"] {
  color: #94a3b8;
  font-size: 2.5rem;
  line-height: 1;
  transition: color .15s ease, transform .15s ease;
}

.feedback-prompt-star.is-previewed > span[aria-hidden="true"] {
  color: var(--primary, #38bdf8);
  transform: scale(1.08);
}

.feedback-prompt-star:has(input:focus-visible) > span[aria-hidden="true"] {
  outline: 2px solid var(--primary, #60a5fa);
  outline-offset: 4px;
  border-radius: 4px;
}

.feedback-prompt-star-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.feedback-prompt-rating-label {
  min-height: 1.4em;
  margin: 8px 0 0;
  text-align: center;
  font-weight: 600;
  color: var(--muted-text, #cbd5e1);
}

.feedback-prompt-textarea {
  width: 100%;
  height: 68px;
  min-height: 68px;
  max-height: 180px;
  padding: 12px 14px;
  box-sizing: border-box;
  overflow-y: hidden;
  resize: none;
}

.feedback-prompt-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--muted-text, #cbd5e1);
}

.feedback-prompt-status:empty {
  min-height: 0;
  margin-top: 0;
}

.feedback-prompt-status[data-state="error"] {
  color: #fca5a5;
}

.feedback-prompt-status[data-state="success"] {
  color: #86efac;
}

@media (max-width: 640px) {
  .feedback-prompt {
    right: 0;
    bottom: 0;
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
  }

  .feedback-prompt-inner {
    max-height: min(82vh, 560px);
    overflow-y: auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .feedback-prompt-star > span[aria-hidden="true"] {
    font-size: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-prompt,
  .feedback-prompt * {
    scroll-behavior: auto;
    transition: none;
  }
}
