.sg-help {
  --sg-help-accent: #8b1e2d;
  --sg-help-accent-hover: #6f1724;
  --sg-help-text: #1a1a1a;
  --sg-help-muted: #666;
  --sg-help-border: #e0dcd4;
  --sg-help-bg: #fff;
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Floating button */
.sg-help__button {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  border: none;
  border-radius: 999px;
  background: var(--sg-help-accent);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: background .15s, transform .15s, opacity .15s;
}

.sg-help__button:hover {
  background: var(--sg-help-accent-hover);
}

.sg-help__button:active {
  transform: scale(.97);
}

.sg-help__button[hidden] {
  display: none;
}

.sg-help__button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  font-weight: 700;
  font-size: .85rem;
  line-height: 1;
}

/* Overlay + sheet */
.sg-help__overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 16, 16, .45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}

.sg-help__overlay.sg-help__overlay--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sg-help__sheet {
  width: 100%;
  max-width: 32rem;
  max-height: 85vh;
  max-height: 85dvh;
  background: var(--sg-help-bg);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform .28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.sg-help__overlay--open .sg-help__sheet {
  transform: translateY(0);
}

@media (min-width: 48rem) {
  .sg-help__overlay {
    align-items: center;
  }

  .sg-help__sheet {
    border-radius: 16px;
    max-height: 80vh;
  }
}

.sg-help__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.1rem 1.25rem .25rem;
  position: relative;
}

.sg-help__head--done {
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding-bottom: .5rem;
}

.sg-help__head--done .sg-help__close {
  position: absolute;
  right: 1.25rem;
  top: 1.1rem;
}

.sg-help__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sg-help-text);
}

.sg-help__title--form {
  flex: 1;
}

.sg-help__title--done {
  display: none;
  text-align: center;
  width: 100%;
  padding-right: 2.5rem;
  padding-left: 2.5rem;
  box-sizing: border-box;
}

.sg-help__head--done .sg-help__title--form,
.sg-help__overlay--done .sg-help__title--form {
  display: none !important;
}

.sg-help__head--done .sg-help__title--done,
.sg-help__overlay--done .sg-help__title--done {
  display: block !important;
}

.sg-help__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: #f1ece5;
  color: var(--sg-help-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.sg-help__close:hover {
  background: #e6ded3;
}

.sg-help__body {
  padding: .5rem 1.25rem 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sg-help__subtitle {
  margin: 0 0 1rem;
  font-size: .92rem;
  line-height: 1.45;
  color: var(--sg-help-muted);
}

.sg-help__textarea {
  width: 100%;
  min-height: 120px;
  padding: .75rem;
  border: 1px solid var(--sg-help-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.sg-help__textarea:focus {
  outline: 2px solid rgba(139, 30, 45, .25);
  border-color: var(--sg-help-accent);
}

/* honeypot — скрыто от людей */
.sg-help__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sg-help__error {
  margin: .65rem 0 0;
  font-size: .88rem;
  color: #c62828;
  display: none;
}

.sg-help__error.sg-help__error--show {
  display: block;
}

.sg-help__actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1rem;
}

.sg-help__btn {
  width: 100%;
  padding: .8rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

.sg-help__btn--primary {
  background: var(--sg-help-accent);
  color: #fff;
}

.sg-help__btn--primary:hover:not(:disabled) {
  background: var(--sg-help-accent-hover);
}

.sg-help__btn--primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.sg-help__btn--secondary {
  background: transparent;
  color: var(--sg-help-muted);
  border: 1px solid var(--sg-help-border);
}

.sg-help__btn--secondary:hover {
  background: #faf9f7;
  color: var(--sg-help-text);
}

/* States */
.sg-help__view {
  display: none;
}

.sg-help__view--active {
  display: block;
}

.sg-help__done-icon {
  width: 3rem;
  height: 3rem;
  margin: .5rem auto 1rem;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.sg-help__done-text {
  margin: 0 0 1rem;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--sg-help-text);
  text-align: center;
}
