#report-issue-root {
  position: relative;
  z-index: 90;
}

#report-issue-trigger {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  width: 3rem;
  height: 3rem;
  padding: 0;
  background: transparent;
  color: rgb(239 68 68 / 1);
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

#report-issue-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(0.2rem);
  border-radius: 0.7rem;
  padding: 0.38rem 0.55rem;
  background: rgb(15 23 42 / 0.96);
  color: rgb(248 250 252 / 1);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 12px 30px -20px rgb(2 6 23 / 0.9);
  transition: opacity 150ms ease, transform 150ms ease;
}

#report-issue-trigger:hover {
  transform: translateY(-2px);
}

#report-issue-trigger:hover::after,
#report-issue-trigger:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#report-issue-trigger:focus-visible,
.report-issue-modal__close:focus-visible,
.report-issue-submit:focus-visible,
.report-issue-form__input:focus-visible,
.report-issue-form__textarea:focus-visible {
  outline: 2px solid rgb(254 202 202 / 0.85);
  outline-offset: 3px;
}

.report-issue-trigger__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgb(239 68 68 / 0.16);
}

.report-issue-trigger__icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.report-issue-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.report-issue-modal.hidden {
  display: none;
}

.report-issue-modal__overlay {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(2 6 23 / 0.72);
  backdrop-filter: blur(8px);
}

.report-issue-modal__panel {
  position: relative;
  z-index: 1;
  width: min(42rem, calc(100vw - 1.5rem));
  max-height: min(88vh, 52rem);
  overflow: auto;
  border: 1px solid rgb(248 113 113 / 0.24);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at top right, rgb(251 113 133 / 0.12), transparent 30%),
    linear-gradient(180deg, rgb(15 23 42 / 0.97), rgb(2 6 23 / 0.98));
  box-shadow: 0 36px 90px -38px rgb(2 6 23 / 0.92);
}

.report-issue-modal__header {
  position: relative;
  padding: 1.25rem 1.25rem 1rem;
  padding-inline-end: 4.5rem;
  border-bottom: 1px solid rgb(148 163 184 / 0.18);
}

.report-issue-modal__eyebrow {
  margin: 0;
  color: rgb(252 165 165 / 0.92);
  font-size: 0.72rem;
  font-weight: 700;
}

.report-issue-modal__title {
  margin: 0.3rem 0 0;
  color: rgb(255 255 255 / 1);
  font-size: 1.1rem;
  font-weight: 800;
}

.report-issue-modal__subtitle {
  margin: 0.45rem 0 0;
  color: rgb(203 213 225 / 1);
  font-size: 0.85rem;
  line-height: 1.9;
}

.report-issue-modal__close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(148 163 184 / 0.24);
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: rgb(15 23 42 / 0.55);
  color: rgb(241 245 249 / 1);
  flex-shrink: 0;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.report-issue-modal__close:hover {
  border-color: rgb(248 113 113 / 0.45);
  background: rgb(127 29 29 / 0.28);
  color: rgb(255 255 255 / 1);
  transform: translateY(-1px);
}

.report-issue-modal__close svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.report-issue-status {
  margin: 1rem 1.25rem 0;
  border: 1px solid transparent;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  line-height: 1.9;
}

.report-issue-status.hidden {
  display: none;
}

.report-issue-status[data-status="success"] {
  border-color: rgb(74 222 128 / 0.28);
  background: rgb(20 83 45 / 0.22);
  color: rgb(220 252 231 / 1);
}

.report-issue-status[data-status="error"] {
  border-color: rgb(251 113 133 / 0.3);
  background: rgb(127 29 29 / 0.2);
  color: rgb(255 228 230 / 1);
}

.report-issue-modal__body {
  padding: 1rem 1.25rem 1.25rem;
}

.report-issue-context-card {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgb(148 163 184 / 0.16);
  border-radius: 1.15rem;
  background: rgb(15 23 42 / 0.52);
}

.report-issue-context-card__label {
  display: block;
  margin-bottom: 0.4rem;
  color: rgb(148 163 184 / 1);
  font-size: 0.72rem;
  font-weight: 700;
}

.report-issue-context-card__value {
  margin: 0;
  color: rgb(248 250 252 / 1);
  font-size: 0.86rem;
  line-height: 1.8;
  word-break: break-word;
}

.report-issue-form {
  display: grid;
  gap: 1rem;
}

.report-issue-form__label {
  display: block;
  margin-bottom: 0.45rem;
  color: rgb(241 245 249 / 1);
  font-size: 0.82rem;
  font-weight: 700;
}

.report-issue-form__input,
.report-issue-form__textarea {
  width: 100%;
  border: 1px solid rgb(71 85 105 / 0.95);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgb(2 6 23 / 0.72);
  color: rgb(248 250 252 / 1);
  font-size: 0.9rem;
}

.report-issue-form__textarea {
  resize: vertical;
  min-height: 7.5rem;
}

.report-issue-form__input::placeholder,
.report-issue-form__textarea::placeholder {
  color: rgb(148 163 184 / 0.95);
}

.report-issue-contact-row {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-issue-contact-row.hidden {
  display: none;
}

.report-issue-hints {
  border: 1px dashed rgb(248 113 113 / 0.22);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgb(127 29 29 / 0.08);
}

.report-issue-hints p {
  margin: 0;
  color: rgb(203 213 225 / 1);
  font-size: 0.8rem;
  line-height: 1.9;
}

.report-issue-form__actions {
  display: flex;
  justify-content: flex-end;
}

.report-issue-submit {
  border: 1px solid rgb(251 113 133 / 0.36);
  border-radius: 1rem;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(135deg, rgb(190 24 93 / 0.95), rgb(220 38 38 / 0.94));
  color: rgb(255 255 255 / 1);
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 18px 38px -22px rgb(190 24 93 / 0.95);
}

.report-issue-submit[disabled] {
  opacity: 0.7;
  cursor: wait;
}

html[data-theme="light"] #report-issue-trigger {
  background: transparent;
  color: rgb(127 29 29 / 1);
  box-shadow: none;
}

html[data-theme="light"] .report-issue-trigger__icon {
  background: rgb(239 68 68 / 0.14);
}

html[data-theme="light"] .report-issue-trigger__icon {
  background: rgb(251 113 133 / 0.12);
}

html[data-theme="light"] .report-issue-modal__overlay {
  background: rgb(15 23 42 / 0.46);
}

html[data-theme="light"] .report-issue-modal__panel {
  border-color: rgb(254 205 211 / 1);
  background:
    radial-gradient(circle at top right, rgb(251 113 133 / 0.1), transparent 30%),
    linear-gradient(180deg, rgb(255 255 255 / 0.99), rgb(248 250 252 / 0.98));
  box-shadow: 0 28px 72px -34px rgb(15 23 42 / 0.28);
}

html[data-theme="light"] .report-issue-modal__title,
html[data-theme="light"] .report-issue-context-card__value,
html[data-theme="light"] .report-issue-form__label {
  color: rgb(15 23 42 / 1);
}

html[data-theme="light"] .report-issue-modal__subtitle,
html[data-theme="light"] .report-issue-hints p {
  color: rgb(71 85 105 / 1);
}

html[data-theme="light"] .report-issue-modal__close,
html[data-theme="light"] .report-issue-form__input,
html[data-theme="light"] .report-issue-form__textarea,
html[data-theme="light"] .report-issue-context-card {
  border-color: rgb(203 213 225 / 1);
  background: rgb(255 255 255 / 1);
  color: rgb(15 23 42 / 1);
}

html[data-theme="light"] .report-issue-form__input::placeholder,
html[data-theme="light"] .report-issue-form__textarea::placeholder,
html[data-theme="light"] .report-issue-context-card__label {
  color: rgb(100 116 139 / 1);
}

html[data-theme="light"] .report-issue-hints {
  border-color: rgb(254 205 211 / 1);
  background: rgb(255 241 242 / 1);
}

@media (max-width: 767px) {
  #report-issue-trigger {
    left: 0.75rem;
    bottom: 0.75rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .report-issue-context-card,
  .report-issue-contact-row {
    grid-template-columns: 1fr;
  }

  .report-issue-form__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .report-issue-submit,
  .report-issue-modal__close {
    text-align: center;
  }

  .report-issue-modal__close {
    top: 0.85rem;
    inset-inline-end: 0.85rem;
  }
}
