html {
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}

.site-brand span,
.site-nav a {
  font-size: 0.95rem;
}

.back-to-top,
.feedback-trigger {
  position: fixed;
  right: 1.5rem;
  z-index: 30;
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(48, 25, 52, 0.92);
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.back-to-top {
  bottom: 1.5rem;
  font-size: 1.4rem;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.feedback-trigger {
  top: 5.25rem;
}

.feedback-trigger svg {
  width: 22px;
  height: 22px;
}

.back-to-top:hover,
.feedback-trigger:hover {
  transform: translateY(-2px);
  border-color: var(--coral, #e57cd8);
  color: var(--coral, #e57cd8);
}

.back-to-top:focus-visible,
.feedback-trigger:focus-visible,
.feedback-dialog button:focus-visible,
.feedback-dialog input:focus-visible,
.feedback-dialog textarea:focus-visible {
  outline: 3px solid var(--coral, #e57cd8);
  outline-offset: 3px;
}

.feedback-dialog {
  width: min(92vw, 480px);
  max-height: min(88vh, 680px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: #301934;
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.feedback-dialog::backdrop {
  background: rgba(17, 8, 20, 0.72);
  backdrop-filter: blur(4px);
}

.feedback-form {
  display: grid;
  gap: 1.15rem;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.feedback-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.feedback-heading h2 {
  margin: 0 0 0.25rem;
  color: white;
  font-size: 1.5rem;
}

.feedback-heading p,
.feedback-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
}

.feedback-close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
}

.feedback-field {
  display: grid;
  gap: 0.45rem;
  color: white;
  font-weight: 600;
}

.feedback-field input,
.feedback-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font: inherit;
  font-weight: 400;
}

.feedback-field input {
  min-height: 44px;
  padding: 0.7rem 0.8rem;
}

.feedback-field textarea {
  min-height: 130px;
  padding: 0.8rem;
  resize: vertical;
}

.feedback-rating {
  border: 0;
}

.feedback-rating legend {
  margin-bottom: 0.4rem;
  color: white;
  font-weight: 600;
}

.feedback-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.feedback-stars input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.feedback-stars label {
  padding: 0 0.15rem;
  color: rgba(255, 255, 255, 0.28);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.feedback-stars label:hover,
.feedback-stars label:hover ~ label,
.feedback-stars input:checked ~ label {
  color: #ffd166;
}

.feedback-stars label:hover {
  transform: scale(1.08);
}

.feedback-stars input:focus-visible + label {
  outline: 3px solid var(--coral, #e57cd8);
  outline-offset: 2px;
  border-radius: 4px;
}

.feedback-submit {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--coral, #e57cd8);
  color: #301934;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.feedback-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.feedback-status {
  min-height: 1.4em;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.feedback-status[data-state="success"] {
  color: #9be7b0;
}

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

.feedback-honeypot {
  position: absolute;
  left: -10000px;
}

@media (max-width: 700px) {
  .site-brand span,
  .site-nav a {
    font-size: 0.82rem;
  }

  .back-to-top,
  .feedback-trigger {
    display: none;
    right: 1rem;
  }

  .back-to-top {
    bottom: 1rem;
  }

  .feedback-trigger {
    top: 5rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .back-to-top,
  .feedback-trigger {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .back-to-top,
  .feedback-trigger,
  .feedback-stars label {
    transition: none;
  }
}
