.feedback-link {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 0 .85rem;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  font: 600 .8125rem/1.2 system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px #0f172a36;
}

.feedback-link:hover {
  background: #334155;
  color: #fff;
}

.feedback-link:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 3px;
}

.feedback-link--floating,
.feedback-link--editor {
  position: fixed;
  z-index: 30;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
}

.feedback-link--dock {
  flex-shrink: 0;
  align-self: flex-start;
}

.feedback-link__icon {
  box-sizing: border-box;
  position: relative;
  width: 16px;
  height: 13px;
  margin-bottom: 3px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.feedback-link__icon::after {
  position: absolute;
  bottom: -4px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  background: #1e293b;
  transform: skewY(-35deg);
  content: '';
}

.feedback-link:hover .feedback-link__icon::after {
  background: #334155;
}

.feedback-link--dock .feedback-link__label {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}

@media (max-width: 39.999rem) {
  body:has(> .feedback-link--floating) {
    padding-bottom: 4rem;
  }

  .feedback-link__label {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
  }
}

.feedback-link--editor {
  display: none;
}

@media (min-width: 64rem) {
  .feedback-link--editor {
    display: inline-flex;
  }
  .feedback-link--dock {
    display: none;
  }
}

button.feedback-link {
  border: 0;
  cursor: pointer;
}

.feedback-dialog {
  box-sizing: border-box;
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1.25rem;
  border: 0;
  border-radius: .9rem;
  background: white;
  color: #0f172a;
  box-shadow: 0 16px 50px #0f172a55;
}

.feedback-dialog::backdrop { background: #0f172a80; }

.feedback-form {
  display: grid;
  gap: .65rem;
  font: 400 .875rem/1.45 system-ui, sans-serif;
}

.feedback-form h2 { margin: 0 0 .3rem; font-size: 1.25rem; font-weight: 650; }
.feedback-form label { font-weight: 600; }

.feedback-form textarea,
.feedback-form input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  padding: .65rem;
  border: 1px solid #94a3b8;
  border-radius: .4rem;
  background: white;
  color: #0f172a;
  font: inherit;
  font-size: 1rem;
}

.feedback-form textarea { resize: vertical; }
.feedback-form__trap { position: absolute; left: -10000px; }
.feedback-form__status { margin: 0; }
.feedback-form__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }

.feedback-form__actions button {
  min-height: 44px;
  padding: 0 .85rem;
  border: 1px solid #cbd5e1;
  border-radius: .45rem;
  background: white;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.feedback-form__actions button[type="submit"] { border-color: #1e293b; background: #1e293b; color: white; }
.feedback-form__actions button:disabled { opacity: .6; cursor: wait; }
