#speedtest-widget {
  position: fixed !important;
  bottom: 20px !important; /* Базовое положение для десктопа */
  left: 20px !important;
  z-index: 1000 !important;
  font-family: 'Merriweather Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

#speedtest-widget.speedtest-collapsed {
  width: 60px !important;
  height: 60px !important;
  background-color: #3b82f6 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: all 0.3s ease-in-out !important;
  overflow: hidden !important;
}

#speedtest-widget.speedtest-collapsed .speedtest-header {
  display: none !important;
}

#speedtest-widget.speedtest-collapsed .widget-icon {
  font-size: 28px !important;
  color: #fff !important;
  display: block !important;
  line-height: 1 !important;
}

#speedtest-widget.speedtest-collapsed h3,
#speedtest-widget.speedtest-collapsed #toggle-speedtest,
#speedtest-widget.speedtest-collapsed #reload-speedtest,
#speedtest-widget.speedtest-collapsed .speedtest-body {
  display: none !important;
}

#speedtest-widget:not(.speedtest-collapsed) {
  width: 90% !important;
  max-width: 340px !important;
  background-color: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease-in-out !important;
}

.speedtest-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 6.8px 15px !important;
  background-color: #3b82f6 !important;
  color: #fff !important;
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
}

.speedtest-header .widget-icon {
  font-size: 18px !important;
  margin-right: 10px !important;
}

.speedtest-header h3 {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#toggle-speedtest {
  background: none !important;
  border: none !important;
  color: #fff !important;
  font-size: 18px !important;
  cursor: pointer !important;
}

.speedtest-body {
  padding: 15px !important;
}

.speedtest-body iframe {
  border: none !important;
  width: 100 !important;
  height: 600px !important;
  border-radius: 0 0 8px 8px !important;
  margin-bottom: 10px !important;
}

#reload-speedtest {
  display: block !important;
  padding: 8px !important;
  background-color: #3b82f6 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  text-align: center !important;
  margin: 0 auto !important;
  max-width: 200px !important;
}

#reload-speedtest:hover {
  background-color: #2563eb !important;
}

/* Адаптивность */
@media (max-width: 600px) {
  #speedtest-widget:not(.speedtest-collapsed) {
      width: 95% !important;
      max-width: none !important;
  }
  #speedtest-widget.speedtest-collapsed {
      width: 50px !important;
      height: 50px !important;
      bottom: 15px !important; /* Скорректировано до 15px для соответствия техподдержке */
  }
  .speedtest-body iframe {
      height: 450px !important;
  }
  #speedtest-widget.speedtest-collapsed .widget-icon {
      font-size: 20px !important;
  }
}
