.bug-report-trigger {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 52px;
  height: 52px;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: #245f4b;
  color: #fff;
  box-shadow: 0 14px 36px rgba(18, 42, 33, 0.34);
  font: 800 0.88rem/1 var(--font-sans);
  cursor: pointer;
  transition: right 180ms ease, transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.bug-report-trigger.shares-floating-row {
  right: calc(max(1rem, env(safe-area-inset-right)) + 60px);
}

.back-to-top.shares-floating-row {
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
}

.bug-report-trigger svg {
  flex: 0 0 auto;
}

.bug-report-trigger span {
  max-width: 120px;
  opacity: 1;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 250ms ease, opacity 180ms ease;
}

.bug-report-trigger:hover span,
.bug-report-trigger:focus-visible span {
  max-width: 120px;
  opacity: 1;
}

.bug-report-trigger:hover,
.bug-report-trigger:focus-visible {
  background: #194b3a;
  box-shadow: 0 18px 42px rgba(18, 42, 33, 0.42);
  transform: translateY(-2px);
}

.bug-report-dialog {
  width: min(620px, calc(100% - 2rem));
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(184, 217, 202, 0.25);
  border-radius: 22px;
  background: #fbfcf8;
  color: #19251f;
  box-shadow: 0 30px 90px rgba(7, 15, 12, 0.58);
}

.bug-report-dialog::backdrop {
  background: rgba(8, 15, 12, 0.72);
  backdrop-filter: blur(5px);
}

.bug-report-dialog form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.bug-report-dialog-head,
.bug-report-title-lockup,
.bug-report-label-row,
.bug-report-actions {
  display: flex;
  align-items: center;
}

.bug-report-dialog-head {
  justify-content: space-between;
  gap: 1rem;
}

.bug-report-title-lockup {
  gap: 0.8rem;
  min-width: 0;
}

.bug-report-dialog-icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: #dfece4;
  color: #245f4b;
}

.bug-report-dialog h2 {
  margin: 0.12rem 0 0;
  color: #19251f;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  line-height: 1.1;
}

.bug-report-kicker {
  color: #315f4c;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.bug-report-close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid #cbd5ce;
  border-radius: 50%;
  background: #fff;
  color: #27352e;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.bug-report-close:hover,
.bug-report-close:focus-visible {
  background: #edf3ee;
  border-color: #6f9180;
}

.bug-report-intro,
.bug-report-privacy {
  margin: 0;
  color: #536159;
  line-height: 1.55;
}

.bug-report-context {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #ccdbd2;
  border-radius: 13px;
  background: #edf4ef;
}

.bug-report-context-check {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #315f4c;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.bug-report-context > span:last-child,
.bug-report-context strong,
.bug-report-context small {
  display: block;
}

.bug-report-context strong {
  color: #27352e;
  font-size: 0.85rem;
}

.bug-report-context small {
  max-width: 48ch;
  margin-top: 0.12rem;
  overflow: hidden;
  color: #617068;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bug-report-field {
  display: grid;
  gap: 0.4rem;
}

.bug-report-label-row {
  justify-content: space-between;
  gap: 1rem;
}

.bug-report-label-row strong {
  color: #19251f;
}

.bug-report-label-row small,
.bug-report-help {
  color: #617068;
  font-size: 0.8rem;
}

.bug-report-dialog textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid #aebdb4;
  border-radius: 13px;
  background: #fff;
  color: #19251f;
  padding: 0.9rem;
  font: inherit;
  line-height: 1.5;
}

.bug-report-dialog textarea::placeholder {
  color: #78847d;
  opacity: 1;
}

.bug-report-dialog textarea:focus {
  border-color: #3f755f;
  outline: 3px solid rgba(63, 117, 95, 0.16);
  outline-offset: 1px;
}

.bug-report-privacy {
  padding-left: 1.6rem;
  font-size: 0.77rem;
  background: linear-gradient(#617068, #617068) 0.35rem 0.4rem / 0.55rem 0.55rem no-repeat;
  background-clip: padding-box;
}

.bug-report-status {
  display: none;
  padding: 0.75rem 0.85rem;
  border-radius: 11px;
  font-weight: 750;
}

.bug-report-status.is-success,
.bug-report-status.is-error {
  display: block;
}

.bug-report-status.is-success {
  color: #1f5b3d;
  background: #e4f3e9;
  border: 1px solid #a7cbb5;
}

.bug-report-status.is-error {
  color: #842f2f;
  background: #f9e5e2;
  border: 1px solid #dfb4ae;
}

.bug-report-actions {
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

.bug-report-actions .button {
  min-height: 44px;
  border-radius: 999px;
}

@media (max-width: 560px) {
  .bug-report-trigger {
    width: auto;
    min-width: 118px;
    height: 48px;
    padding: 0 0.8rem;
  }

  .bug-report-trigger.shares-floating-row {
    right: calc(max(0.875rem, env(safe-area-inset-right)) + 58px);
  }

  .back-to-top.shares-floating-row {
    right: max(0.875rem, env(safe-area-inset-right));
    bottom: max(0.875rem, env(safe-area-inset-bottom));
  }

  .bug-report-trigger span {
    display: inline;
    max-width: none;
    opacity: 1;
  }

  .bug-report-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 17px;
  }

  .bug-report-dialog form {
    padding: 1rem;
  }

  .bug-report-dialog-icon {
    width: 40px;
    height: 40px;
  }

  .bug-report-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bug-report-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bug-report-trigger,
  .bug-report-trigger span {
    transition: none;
  }
}
