.tgstat-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(48, 55, 68, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tgstat-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.tgstat-overlay__dialog {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 24px 48px rgba(48, 55, 68, 0.28),
    0 8px 16px rgba(48, 55, 68, 0.12);
  font-family: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #474d56;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.tgstat-overlay.is-open .tgstat-overlay__dialog {
  transform: translateY(0) scale(1);
}

.tgstat-overlay__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #303744 0%, #3a4354 100%);
}

.tgstat-overlay__logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.tgstat-overlay__brand {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #bbe4f0;
  line-height: 1;
}

.tgstat-overlay__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tgstat-overlay__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.tgstat-overlay__body {
  padding: 28px 28px 24px;
  text-align: center;
}

.tgstat-overlay__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(68, 186, 220, 0.15) 0%, rgba(68, 186, 220, 0.06) 100%);
  color: #44badc;
}

.tgstat-overlay__icon svg {
  width: 32px;
  height: 32px;
}

.tgstat-overlay__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: #303744;
}

.tgstat-overlay__text {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.6;
  color: #5a6270;
}

.tgstat-overlay__note {
  margin: 0 0 24px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f7fb;
  font-size: 13px;
  line-height: 1.55;
  color: #7f8894;
  text-align: left;
}

.tgstat-overlay__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 200px;
  min-height: 46px;
  padding: 0 28px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #44badc 0%, #36a8cc 100%);
  box-shadow: 0 4px 14px rgba(68, 186, 220, 0.35);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.tgstat-overlay__button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tgstat-overlay__button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(68, 186, 220, 0.45);
}

.tgstat-overlay__button:active:not(:disabled) {
  transform: translateY(0);
}

.tgstat-overlay__button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.tgstat-overlay__status {
  margin: 14px 0 0;
  min-height: 20px;
  font-size: 13px;
  line-height: 1.4;
  color: #98a6ad;
}

.tgstat-overlay__status.is-error {
  color: #fa6767;
}

@media (max-width: 480px) {
  .tgstat-overlay {
    padding: 16px;
  }

  .tgstat-overlay__body {
    padding: 24px 20px 20px;
  }

  .tgstat-overlay__title {
    font-size: 17px;
  }

  .tgstat-overlay__text {
    font-size: 14px;
  }

  .tgstat-overlay__button {
    width: 100%;
    min-width: 0;
  }
}
