.support-widget {
  --support-ink: #172033;
  --support-muted: #536176;
  --support-border: #cbd5e1;
  --support-accent: #155eef;
  color: var(--support-ink);
  font-family: inherit;
}

.support-widget__launcher {
  position: fixed;
  z-index: 1040;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #123b75;
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 28px #102a4c40;
  cursor: pointer;
}

.support-widget__manage-launcher {
  z-index: 1041;
}

.support-widget__manage-launcher--with-submit {
  transform: translateY(calc(-100% - 0.75rem));
}

.support-widget__launcher span:first-child {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.support-widget__launcher:hover,
.support-widget__submit:hover {
  background: #0b2c5a;
}

.support-widget button:focus-visible,
.support-widget input:focus-visible,
.support-widget textarea:focus-visible,
.support-widget select:focus-visible,
.support-widget summary:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

.support-widget__dialog {
  width: min(760px, calc(100vw - 1.25rem));
  max-width: 760px;
  max-height: min(92dvh, 900px);
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--support-border);
  border-radius: 18px;
  color: var(--support-ink);
  box-shadow: 0 24px 80px #0f172a40;
}

.support-widget__dialog::backdrop {
  background: #0f172a99;
  backdrop-filter: blur(2px);
}

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

.support-widget__header h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}

.support-widget__eyebrow {
  margin: 0 0 0.2rem;
  color: var(--support-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.support-widget__close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--support-border);
  border-radius: 50%;
  background: #fff;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.support-widget__intro,
.support-widget__privacy {
  color: var(--support-muted);
  line-height: 1.5;
}

.support-widget__scope {
  display: block;
  margin: 0.75rem 0;
  font-weight: 600;
}

.support-widget__scope select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
}

.support-widget__intro {
  margin: 0.75rem 0;
}

.support-widget__status {
  min-height: 1.4em;
  margin: 0.5rem 0;
  color: #075985;
  font-weight: 600;
}

.support-widget__status:empty {
  display: none;
}

.support-widget__status[data-error="true"] {
  color: #b42318;
}

.support-widget__status[data-success="true"] {
  color: #067647;
}

.support-widget__form,
.support-widget__form label {
  display: grid;
  gap: 0.45rem;
}

.support-widget__form {
  gap: 0.9rem;
}

.support-widget__form label {
  color: var(--support-ink);
  font-weight: 600;
}

.support-widget__form input:not([type="file"]):not([type="checkbox"]),
.support-widget__form textarea,
.support-widget__form select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-weight: 400;
}

.support-widget__form .support-widget__consent {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.7rem;
  font-weight: 500;
}

.support-widget__form .support-widget__consent input[type="checkbox"] {
  width: auto;
  min-height: 1rem;
  margin-top: 0.2rem;
}

.support-widget__form textarea {
  resize: vertical;
}

.support-widget__field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.support-widget__image-section {
  min-width: 0;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--support-border);
  border-radius: 12px;
}

.support-widget__image-section legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0 0.35rem;
  font-weight: 700;
}

.support-widget__privacy,
.support-widget__hint {
  margin: 0.25rem 0 0.65rem;
  font-size: 0.9rem;
}

.support-widget__image-actions,
.support-widget__form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.support-widget__image-actions button,
.support-widget__upload,
.support-widget__button--quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid #8aa0bd;
  border-radius: 8px;
  background: #fff;
  color: #123b75;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.support-widget__upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.support-widget__upload:focus-within {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}

.support-widget__preview {
  margin-top: 0.9rem;
}

.support-widget__preview canvas {
  display: block;
  max-width: 100%;
  max-height: 48dvh;
  margin: 0.5rem auto;
  border: 1px solid var(--support-border);
  background: #e2e8f0;
  cursor: crosshair;
  touch-action: none;
}

.support-widget__diagnostics {
  padding: 0.85rem;
  border: 1px solid var(--support-border);
  border-radius: 12px;
}

.support-widget__diagnostics summary {
  font-weight: 700;
  cursor: pointer;
}

.support-widget__diagnostics textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.support-widget__form-actions {
  justify-content: flex-end;
}

.support-widget__submit {
  min-height: 48px;
  padding: 0.7rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: var(--support-accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.support-widget__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.support-widget__mine {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--support-border);
}

.support-widget__mine-toggle {
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  color: #123b75;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.support-widget__mine ul {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.support-widget__mine li {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--support-border);
  border-radius: 8px;
}

@media (max-width: 600px) {
  .support-widget__launcher {
    right: max(0.65rem, env(safe-area-inset-right));
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    min-height: 46px;
    padding: 0.6rem 0.8rem;
  }

  .support-widget__field-grid {
    grid-template-columns: 1fr;
  }

  .support-widget__image-actions > * {
    flex: 1 1 100%;
  }

  .support-widget__dialog {
    width: calc(100vw - 0.75rem);
    max-height: 95dvh;
    padding: 1rem;
  }
}
