#article-feedback[hidden] {
  display: none !important;
}

#article-feedback .article-feedback-body,
#article-feedback-survey {
  width: 100%;
}

/*
 * PostHog custom survey UI.
 *
 * This follows PostHog's documented custom-survey integration path and mirrors
 * the current default Survey appearance values from posthog-js. No deprecated
 * renderSurvey() API is used.
 */
#article-feedback-survey {
  --ph-survey-background-color: #eeeded;
  --ph-survey-border-color: #c9c6c6;
  --ph-survey-submit-button-color: #000;
  --ph-survey-submit-button-text-color: #fff;
  --ph-survey-rating-bg-color: #fff;
  --ph-survey-rating-active-bg-color: #000;
  --ph-survey-text-primary-color: #020617;
  --ph-survey-text-subtle-color: #939393;
  --ph-survey-input-background: #fff;
  --ph-survey-placeholder: 'Start typing...';
}

#article-feedback-survey .article-feedback-card {
  box-sizing: border-box;
  width: 100%;
  padding: 20px 24px;
  margin: 0;
  color: var(--ph-survey-text-primary-color);
  background: var(--ph-survey-background-color);
  border: 1.5px solid var(--ph-survey-border-color);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', Helvetica, Arial,
    sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

#article-feedback-survey .article-feedback-question {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#article-feedback-survey .article-feedback-question-title {
  margin: 0;
  color: var(--ph-survey-text-primary-color);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

#article-feedback-survey .article-feedback-question-description {
  margin: -8px 0 0;
  color: var(--ph-survey-text-primary-color);
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}

#article-feedback-survey .article-feedback-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#article-feedback-survey .article-feedback-rating {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  border: 1.5px solid var(--ph-survey-border-color);
  border-radius: 6px;
}

#article-feedback-survey .article-feedback-rating-button {
  box-sizing: border-box;
  padding: 8px 0;
  color: var(--ph-survey-text-primary-color);
  background: var(--ph-survey-rating-bg-color);
  border: 0;
  border-right: 1px solid var(--ph-survey-border-color);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s ease-out,
    color 0.2s ease-out,
    transform 0.15s ease-out;
}

#article-feedback-survey .article-feedback-rating-button:last-child {
  border-right: 0;
}

#article-feedback-survey .article-feedback-rating-button:hover:not(.is-active) {
  background: color-mix(
    in srgb,
    var(--ph-survey-rating-active-bg-color) 14%,
    var(--ph-survey-rating-bg-color)
  );
}

#article-feedback-survey .article-feedback-rating-button.is-active {
  color: var(--ph-survey-submit-button-text-color);
  background: var(--ph-survey-rating-active-bg-color);
}

#article-feedback-survey .article-feedback-rating-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ph-survey-text-primary-color);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.7;
}

#article-feedback-survey .article-feedback-textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 100%;
  resize: vertical;
  padding: 10px;
  color: var(--ph-survey-text-primary-color);
  background: var(--ph-survey-input-background);
  border: 1.5px solid var(--ph-survey-border-color);
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition:
    border-color 0.2s ease-out,
    box-shadow 0.2s ease-out;
}

#article-feedback-survey .article-feedback-textarea:focus {
  border-color: var(--ph-survey-rating-active-bg-color);
  box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
  outline: 1.5px solid rgb(59 130 246 / 80%);
  outline-offset: 2px;
}

#article-feedback-survey .article-feedback-submit {
  width: 100%;
  min-width: 100%;
  padding: 12px;
  color: var(--ph-survey-submit-button-text-color);
  background: var(--ph-survey-submit-button-color);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 2px 0 rgb(0 0 0 / 4.5%);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    opacity 0.2s ease-out;
}

#article-feedback-survey .article-feedback-submit:not(:disabled):hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgb(0 0 0 / 10%);
}

#article-feedback-survey .article-feedback-submit:not(:disabled):active {
  transform: scale(0.98);
}

#article-feedback-survey .article-feedback-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#article-feedback-survey .article-feedback-branding {
  align-self: center;
  color: var(--ph-survey-text-primary-color);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease-out;
}

#article-feedback-survey .article-feedback-branding:hover {
  opacity: 1;
}

#article-feedback-survey .article-feedback-thank-you {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

#article-feedback-survey .article-feedback-thank-you h3 {
  margin: 10px 0 0;
  color: var(--ph-survey-text-primary-color);
  font-size: 16px;
}

#article-feedback-survey .article-feedback-thank-you p {
  margin: 0;
  color: var(--ph-survey-text-primary-color);
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.8;
}

@media (max-width: 480px) {
  #article-feedback-survey .article-feedback-textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #article-feedback-survey * {
    transition-duration: 0.01ms !important;
  }
}
