.support-widget {
  --sw-text: var(--text, #1f2731);
  --sw-primary: var(--primary, #138a78);
  --sw-primary-2: var(--primary-2, #0f7365);
  --sw-accent: var(--accent, #e77d4f);
  --sw-panel: var(--glass-fill, linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(253, 247, 238, 0.52)));
  --sw-border-strong: var(--glass-border-strong, rgba(255, 255, 255, 0.76));
  --sw-shadow-soft: var(--glass-shadow-soft, 0 10px 24px rgba(31, 39, 49, 0.08));
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10050;
  width: 112px;
  height: 168px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

#gptishka-support-widget.support-widget {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
  z-index: 10050 !important;
}

.support-widget.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.support-widget__mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: 112px;
  height: 168px;
  display: block;
  pointer-events: auto;
  cursor: default;
  user-select: none;
  -webkit-user-drag: none;
}

.support-widget__mascot-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 12px 24px rgba(19, 138, 120, 0.24));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.support-widget__resume-bubble {
  position: absolute;
  right: 18px;
  bottom: 188px;
  z-index: 4;
  width: min(320px, calc(100vw - 160px));
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--sw-border-strong);
  background:
    radial-gradient(180px 120px at 100% -10%, rgba(231, 125, 79, 0.17), transparent 70%),
    radial-gradient(160px 110px at -8% 110%, rgba(19, 138, 120, 0.14), transparent 70%),
    var(--sw-panel);
  box-shadow: var(--sw-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  text-decoration: none;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease, bottom 240ms ease;
}

.support-widget__resume-bubble[hidden] {
  display: none !important;
}

.support-widget__resume-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.support-widget__resume-bubble::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--sw-border-strong);
  border-bottom: 1px solid var(--sw-border-strong);
  background: rgba(255, 251, 245, 0.92);
  transform: rotate(45deg);
}

.support-widget__resume-bubble:hover,
.support-widget__resume-bubble:focus-visible {
  box-shadow: 0 14px 28px rgba(31, 39, 49, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px) scale(1.01);
  outline: none;
}

.support-widget__resume-text {
  color: #33424d;
  font-size: 12px;
  line-height: 1.35;
}

.support-widget__resume-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.support-widget__resume-link {
  color: var(--sw-primary-2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.support-widget__resume-link:hover,
.support-widget__resume-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.support-widget__resume-cancel {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #637489;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.support-widget__resume-cancel:hover,
.support-widget__resume-cancel:focus-visible {
  color: #33424d;
  text-decoration: underline;
  outline: none;
}

.support-widget__panel {
  position: absolute;
  right: 96px;
  bottom: 22px;
  z-index: 2;
  width: min(340px, calc(100vw - 160px));
  box-sizing: border-box;
  isolation: isolate;
  padding: 15px 15px 13px;
  border-radius: var(--radius-lg, 26px);
  border: 1px solid var(--sw-border-strong);
  background:
    radial-gradient(220px 140px at 100% -10%, rgba(231, 125, 79, 0.18), transparent 68%),
    radial-gradient(180px 140px at -8% 110%, rgba(19, 138, 120, 0.16), transparent 70%),
    var(--sw-panel),
    radial-gradient(180px 140px at 100% 0%, rgba(231, 125, 79, 0.14), transparent 68%),
    radial-gradient(160px 140px at 0% 100%, rgba(19, 138, 120, 0.14), transparent 70%);
  box-shadow: var(--sw-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  transform: translateY(12px) scale(0.97);
  transform-origin: right bottom;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.support-widget__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.24) 1px, transparent 0),
    radial-gradient(circle at 3px 3px, rgba(31, 39, 49, 0.04) 1px, transparent 0);
  background-size: 14px 14px, 20px 20px;
}

.support-widget.is-open .support-widget__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.support-widget__panel:hover {
  box-shadow: 0 24px 46px rgba(31, 39, 49, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.support-widget__title {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "Manrope", system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.16;
  color: #162129;
}

.support-widget__text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--sw-text);
}

.support-widget__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #3f4f5a;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(216, 204, 185, 0.9);
  border-radius: 999px;
}

.support-widget__meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-primary), var(--sw-accent));
  box-shadow: 0 0 0 3px rgba(19, 138, 120, 0.12);
}

.support-widget__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md, 14px);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--sw-primary), #0f8f80);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(19, 138, 120, 0.28);
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.support-widget__cta:hover,
.support-widget__cta:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, var(--sw-primary-2), #0d7569);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(19, 138, 120, 0.32);
  outline: none;
}

.gptishka-resume-activation {
  display: none !important;
}

@media (max-width: 640px) {
  .support-widget {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: 92px;
    height: 140px;
  }

  #gptishka-support-widget.support-widget {
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .support-widget__mascot {
    width: 92px;
    height: 140px;
  }

  .support-widget__resume-bubble {
    right: 12px;
    bottom: 148px;
    width: min(280px, calc(100vw - 108px));
    padding: 9px 10px;
  }

  .support-widget__panel {
    right: 78px;
    bottom: 16px;
    width: min(300px, calc(100vw - 108px));
    padding: 12px 12px 11px;
    border-radius: var(--radius-md, 14px);
  }

  .support-widget__title {
    font-size: 17px;
  }

  .support-widget__text {
    font-size: 13px;
  }

  .support-widget__meta {
    margin-bottom: 10px;
    font-size: 11px;
  }

  .support-widget__resume-text {
    font-size: 11px;
  }

  .support-widget__resume-link,
  .support-widget__resume-cancel {
    font-size: 12px;
  }

  .support-widget__cta {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-widget,
  .support-widget__mascot,
  .support-widget__panel,
  .support-widget__resume-bubble {
    transition: none;
  }
}
