/* Viewer feedback: the footer trigger and a floating panel (a bottom sheet on phones). */
.feedback-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 13px;
  border: 1px solid #aa8cff45;
  border-radius: 999px;
  background: linear-gradient(115deg, #62d9f612, #aa8cff1a, #ef71c40e);
  color: #dce4fa;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.feedback-trigger .icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.feedback-trigger:hover {
  border-color: #62d9f6a0;
  background: linear-gradient(115deg, #62d9f622, #aa8cff28, #ef71c41a);
}

dialog.feedback-panel {
  width: min(380px, calc(100% - 32px));
  inset: auto 24px 24px auto;
  margin: 0;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #172039, #121a2c);
  animation: feedback-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog.feedback-panel::backdrop {
  background: #0509155c;
  backdrop-filter: none;
}
dialog.feedback-panel.closing {
  animation: feedback-out 0.25s ease forwards;
}
.feedback-panel .dialog-heading {
  margin-bottom: 14px;
}
.feedback-panel .dialog-heading h2 {
  font-size: 20px;
}
.feedback-moods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.feedback-legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.feedback-mood {
  position: relative;
  cursor: pointer;
}
.feedback-mood input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.mood-happy {
  --mood: var(--accent);
}
.mood-neutral {
  --mood: var(--violet);
}
.mood-sad {
  --mood: var(--coral);
}
.mood-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 6px 11px;
  border: 1px solid #3a4768;
  border-radius: 12px;
  background: #0b1020;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.feedback-mood:hover .mood-tile {
  border-color: #56648a;
  color: var(--text);
  transform: translateY(-1px);
}
.feedback-mood input:focus-visible + .mood-tile {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.feedback-mood input:checked + .mood-tile {
  border-color: var(--mood);
  color: var(--mood);
  background: #111a33;
  background: color-mix(in srgb, var(--mood) 13%, #0b1020);
  box-shadow:
    inset 0 0 0 1px var(--mood),
    0 10px 26px -14px var(--mood);
}
.feedback-mood input:checked + .mood-tile .mood-label {
  color: var(--text);
}
.face {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.face .eyes {
  stroke-width: 3.6;
}
.feedback-panel .form-label {
  margin: 18px 0 8px;
}
.feedback-panel .form-label span {
  color: var(--muted);
}
.feedback-text {
  display: block;
  min-height: 84px;
  resize: vertical;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.feedback-text::placeholder {
  color: #7d88a4;
}
.feedback-text:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.feedback-panel .feedback-count {
  margin-top: 6px;
  text-align: right;
  font-size: 10px;
  line-height: 1.4;
}
.feedback-panel .feedback-count.near-limit {
  color: var(--coral);
}
.feedback-panel .dialog-actions {
  margin-top: 14px;
}
.feedback-panel .button-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--brand-gradient);
}
.feedback-thanks {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 6px 8px;
  text-align: center;
  outline: none;
}
.feedback-thanks[hidden] {
  display: none;
}
.feedback-thanks-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: var(--accent-ink);
  animation: feedback-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.feedback-thanks-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feedback-thanks h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
@keyframes feedback-out {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes feedback-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.feedback-panel,
  dialog.feedback-panel.closing,
  .feedback-thanks-mark {
    animation: none;
  }
}
@media (max-width: 560px) {
  dialog.feedback-panel {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  .mood-tile {
    padding: 12px 4px 10px;
  }
  .face {
    width: 36px;
    height: 36px;
  }
}
